From 2b9e0c09ee1f307a1b488cbd08a633ed30209ee1 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Fri, 8 Dec 2023 11:58:33 -0500 Subject: [PATCH] fix: applet updates --- .github/workflows/ci.yml | 1 + iced | 2 +- src/applet/mod.rs | 17 +++++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bd7bf50..c432f745 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: - winit - winit_wgpu - wayland + - applet runs-on: ubuntu-22.04 steps: - name: Checkout sources diff --git a/iced b/iced index 4521d6e5..56b6d657 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit 4521d6e584b1cddd00d8d1e7c20784cfd5bcdea9 +Subproject commit 56b6d6571ca4292a3c2293ec05d537e12da972e5 diff --git a/src/applet/mod.rs b/src/applet/mod.rs index e6913bb3..f6de708e 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -89,10 +89,13 @@ impl Context { #[allow(clippy::cast_precision_loss)] pub fn window_settings(&self) -> crate::app::Settings { let (width, height) = self.suggested_size(); - let width = u32::from(width); - let height = u32::from(height); + let width = f32::from(width); + let height = f32::from(height); let mut settings = crate::app::Settings::default() - .size((width + APPLET_PADDING * 2, height + APPLET_PADDING * 2)) + .size(iced_core::Size::new( + width + APPLET_PADDING as f32 * 2., + height + APPLET_PADDING as f32 * 2., + )) .size_limits( Limits::NONE .min_height(height as f32 + APPLET_PADDING as f32 * 2.0) @@ -235,6 +238,8 @@ pub fn run(autosize: bool, flags: App::Flags) -> iced::Result crate::icon_theme::set_default(icon_theme); } + let (width, height) = (settings.size.width as u32, settings.size.height as u32); + let mut core = Core::default(); core.window.show_window_menu = false; core.window.show_headerbar = false; @@ -245,8 +250,8 @@ pub fn run(autosize: bool, flags: App::Flags) -> iced::Result core.debug = settings.debug; core.set_scale_factor(settings.scale_factor); - core.set_window_width(settings.size.0); - core.set_window_height(settings.size.1); + core.set_window_width(width); + core.set_window_height(height); THEME.with(move |t| { let mut cosmic_theme = t.borrow_mut(); @@ -268,7 +273,7 @@ pub fn run(autosize: bool, flags: App::Flags) -> iced::Result autosize: settings.autosize, client_decorations: settings.client_decorations, resizable: settings.resizable, - size: settings.size, + size: (width, height), size_limits: settings.size_limits, title: None, transparent: settings.transparent,