From 33cb23f04fb4fe76c175026c148aaa70efbf8632 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Mon, 6 May 2024 15:15:20 +0200 Subject: [PATCH] fix(input-sources): suggested_padding takes bool for symbolic icon check --- cosmic-applet-input-sources/src/window.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cosmic-applet-input-sources/src/window.rs b/cosmic-applet-input-sources/src/window.rs index 7e94073c..71bc989e 100644 --- a/cosmic-applet-input-sources/src/window.rs +++ b/cosmic-applet-input-sources/src/window.rs @@ -49,13 +49,17 @@ impl cosmic::Application for Window { type Executor = cosmic::SingleThreadExecutor; type Flags = Flags; type Message = Message; + const APP_ID: &'static str = ID; + fn core(&self) -> &Core { &self.core } + fn core_mut(&mut self) -> &mut Core { &mut self.core } + fn init( core: Core, flags: Self::Flags, @@ -73,9 +77,11 @@ impl cosmic::Application for Window { }; (window, Command::none()) } + fn on_close_requested(&self, id: window::Id) -> Option { Some(Message::PopupClosed(id)) } + fn update(&mut self, message: Self::Message) -> Command> { match message { Message::Config(config) => self.config = config, @@ -146,8 +152,9 @@ impl cosmic::Application for Window { } Command::none() } + fn view(&self) -> Element { - let suggested = self.core.applet.suggested_padding(); + let suggested = self.core.applet.suggested_padding(true); widget::button( widget::text( self.active_layouts @@ -161,6 +168,7 @@ impl cosmic::Application for Window { .on_press(Message::TogglePopup) .into() } + fn view_window(&self, _id: Id) -> Element { let mut content_list = widget::column::with_capacity(4 + self.active_layouts.len()).padding([8, 0]); @@ -186,6 +194,7 @@ impl cosmic::Application for Window { self.core.applet.popup_container(content_list).into() } + fn subscription(&self) -> Subscription { struct ConfigSubscription; let config = cosmic_config::config_subscription(