diff --git a/examples/applet/src/window.rs b/examples/applet/src/window.rs index 547863f2..4e05c70a 100644 --- a/examples/applet/src/window.rs +++ b/examples/applet/src/window.rs @@ -128,8 +128,7 @@ impl cosmic::Application for Window { "Example row", cosmic::widget::container( toggler(state.example_row) - .on_toggle(Message::ToggleExampleRow) - .width(Length::Fill), + .on_toggle(Message::ToggleExampleRow), ), )) .add(popup_dropdown( diff --git a/src/applet/mod.rs b/src/applet/mod.rs index e18c9aad..0cbcacab 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -234,7 +234,6 @@ impl Context { }) .width(Length::Fixed(suggested.0 as f32)) .height(Length::Fixed(suggested.1 as f32)); - dbg!(suggested); self.button_from_element(icon, symbolic) } @@ -251,7 +250,6 @@ impl Context { (applet_padding_minor_axis, applet_padding_major_axis) }; - dbg!(suggested.0 + 2 * horizontal_padding); crate::widget::button::custom(layer_container(content).center(Length::Fill)) .width(Length::Fixed((suggested.0 + 2 * horizontal_padding) as f32)) .height(Length::Fixed((suggested.1 + 2 * vertical_padding) as f32)) diff --git a/src/widget/context_menu.rs b/src/widget/context_menu.rs index 25953639..200021c3 100644 --- a/src/widget/context_menu.rs +++ b/src/widget/context_menu.rs @@ -85,7 +85,7 @@ impl ContextMenu<'_, Message> { // close existing popups state.menu_states.clear(); state.active_root.clear(); - dbg!("closing existing popups"); + shell.publish(self.on_surface_action.as_ref().unwrap()(destroy_popup(id))); state.view_cursor = view_cursor; ( diff --git a/src/widget/mod.rs b/src/widget/mod.rs index f63cdc37..eae255bc 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -350,7 +350,7 @@ pub use toaster::{Toast, ToastId, Toasts, toaster}; mod toggler; #[doc(inline)] -pub use toggler::toggler; +pub use toggler::{Toggler, toggler}; #[doc(inline)] pub use tooltip::{Tooltip, tooltip}; diff --git a/src/widget/settings/item.rs b/src/widget/settings/item.rs index a17f2071..110ab7b7 100644 --- a/src/widget/settings/item.rs +++ b/src/widget/settings/item.rs @@ -41,6 +41,7 @@ pub fn item_row(children: Vec>) -> Row { row::with_children(children) .spacing(theme::spacing().space_xs) .align_y(iced::Alignment::Center) + .width(Length::Fill) } /// A settings item aligned in a flex row @@ -59,8 +60,9 @@ pub fn flex_item<'a, Message: 'static>( .wrapping(Wrapping::Word) .width(Length::Fill) .into(), - container(widget).into(), + container(widget).width(Length::Shrink).into(), ]) + .width(Length::Fill) } inner(title.into(), widget.into()) @@ -141,6 +143,10 @@ impl<'a, Message: 'static> Item<'a, Message> { is_checked: bool, message: impl Fn(bool) -> Message + 'static, ) -> Row<'a, Message> { - self.control(crate::widget::toggler(is_checked).on_toggle(message)) + self.control( + crate::widget::toggler(is_checked) + .width(Length::Shrink) + .on_toggle(message), + ) } } diff --git a/src/widget/toggler.rs b/src/widget/toggler.rs index 2cd6a785..12bb8950 100644 --- a/src/widget/toggler.rs +++ b/src/widget/toggler.rs @@ -55,7 +55,7 @@ impl<'a, Message> Toggler<'a, Message> { is_toggled, on_toggle: None, label: None, - width: Length::Fill, + width: Length::Shrink, size: Self::DEFAULT_SIZE, text_size: None, text_line_height: text::LineHeight::default(),