Column width set to widest child

Hi everyone,

I’m new to both Rust and Iced and I’m hoping to get some help with creating a sidebar-like column of buttons on my UI. What I would like to achieve is a layout where the column’s width is dictated by the widest button, and the other buttons are expanded to fill the available horizontal space.

What I came up with so far (see screenshot and code), will either cause the sidebar to be as wide as the window (if each button has width(Length::Fill), which is commented out in the code snippet), or the column will be as wide as the widest button, but all the other buttons will not expand to fill the available horizontal space (I’d like to see the right edges aligned).

Is there a way to achieve this using Iced?

Thanks a bunch!

fn make_side_bar(&self) -> Element<Message> {
    let side_button = |tab, title| {
            .style(if self.active_tab == tab {
            } else {

    let children: Vec<Element<_>> = vec![
            if let ProjectState::ProjectOpened(_) = self.project_state {
            } else {
        side_button(ActiveTab::Encrypt, "Encrypt")