From 8fc0733f738d9b784dfc2f4729b7bb2d42c79b2d Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Fri, 29 Aug 2025 19:05:05 +0200 Subject: [PATCH] battery: Autosize applet for dgpu dot --- cosmic-applet-battery/src/app.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cosmic-applet-battery/src/app.rs b/cosmic-applet-battery/src/app.rs index 051a0ed5..0e3fa86c 100644 --- a/cosmic-applet-battery/src/app.rs +++ b/cosmic-applet-battery/src/app.rs @@ -483,7 +483,7 @@ impl cosmic::Application for CosmicBatteryApplet { .on_press_down(Message::TogglePopup) .into(); - if !self.gpus.is_empty() { + let content = if !self.gpus.is_empty() { let dot = container(vertical_space().height(Length::Fixed(0.0))) .padding(2.0) .class(cosmic::style::Container::Custom(Box::new(|theme| { @@ -511,7 +511,9 @@ impl cosmic::Application for CosmicBatteryApplet { } } else { btn - } + }; + + self.core.applet.autosize_window(content).into() } fn view_window(&self, _id: window::Id) -> Element {