Michael Murphy (S76)

I’m a System76 engineer / Pop!_OS maintainer. I’ve been a Linux user since 2007; and Rust since 2015. I’m currently working on COSMIC-related projects.

  • 55 Posts
  • 272 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle



  • You can either return cosmic::Element<Message>, impl Into<cosmic::Element<Message>>, or cosmic::widget::Button<Message> with your functions.

    Every widget can .into() or .apply(Element::from) into a cosmic::Element.

    I’d recommend using the Grid widget so that your buttons can scale with the window.

    cosmic::widget::grid()
        .push(widget1())
        .push(widget2())
        .push(widget3())
        .insert_row()
        .push(widget4())
        .push(widget5())
        .push(widget6())
        .row_spacing(12)
        .column_spacing(12)
        .justify_content(JustifyContent::Stretch)
        .width(Length::Fill)
        .height(Length::Fill)
        .into()