diff --git a/Cargo.lock b/Cargo.lock index afbc830b..68bfa6d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -763,6 +763,7 @@ dependencies = [ "libcosmic", "once_cell", "rust-embed", + "tracing", "zbus", ] @@ -867,7 +868,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -881,7 +882,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "quote", "syn 1.0.109", @@ -958,7 +959,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "anyhow", "cosmic-config", @@ -981,9 +982,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] @@ -2251,7 +2252,7 @@ dependencies = [ [[package]] name = "iced" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "iced_accessibility", "iced_core", @@ -2266,7 +2267,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "accesskit", "accesskit_unix", @@ -2275,7 +2276,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "bitflags 1.3.2", "iced_accessibility", @@ -2290,7 +2291,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.6.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "futures", "iced_core", @@ -2303,7 +2304,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.8.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2320,7 +2321,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2332,7 +2333,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "iced_accessibility", "iced_core", @@ -2344,7 +2345,7 @@ dependencies = [ [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "enum-repr", "float-cmp", @@ -2366,7 +2367,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.8.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "iced_core", "once_cell", @@ -2376,7 +2377,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "bytemuck", "cosmic-text", @@ -2394,7 +2395,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2415,7 +2416,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "iced_renderer", "iced_runtime", @@ -2663,7 +2664,7 @@ checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic/#bf456a08ee81aaebcbcea87d94079c87dc032e28" +source = "git+https://github.com/pop-os/libcosmic/#ce685b5aebabafafedf3480b1a41a68c3afd34ec" dependencies = [ "apply", "cosmic-config", @@ -3027,9 +3028,9 @@ dependencies = [ [[package]] name = "notify" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d9ba6c734de18ca27c8cef5cd7058aa4ac9f63596131e4c7e41e579319032a2" +checksum = "5738a2795d57ea20abec2d6d76c6081186709c0024187cd5977265eda6598b51" dependencies = [ "bitflags 1.3.2", "crossbeam-channel", @@ -3937,9 +3938,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" dependencies = [ "itoa", "ryu", diff --git a/cosmic-applet-graphics/Cargo.toml b/cosmic-applet-graphics/Cargo.toml index 321fe987..7fbda917 100644 --- a/cosmic-applet-graphics/Cargo.toml +++ b/cosmic-applet-graphics/Cargo.toml @@ -14,3 +14,4 @@ once_cell = "1" i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] } i18n-embed-fl = "0.6.4" rust-embed = "6.3.0" +tracing = "0.1" diff --git a/cosmic-applet-graphics/src/window.rs b/cosmic-applet-graphics/src/window.rs index 910a8bcc..3941014e 100644 --- a/cosmic-applet-graphics/src/window.rs +++ b/cosmic-applet-graphics/src/window.rs @@ -179,7 +179,7 @@ impl Application for Window { Message::CurrentGraphics(match cur_graphics { Ok(g) => Some(g), Err(err) => { - dbg!(err); + tracing::error!("{:?}", err); None } }) diff --git a/cosmic-applet-workspaces/src/components/app.rs b/cosmic-applet-workspaces/src/components/app.rs index 14cd9908..b4ac794d 100644 --- a/cosmic-applet-workspaces/src/components/app.rs +++ b/cosmic-applet-workspaces/src/components/app.rs @@ -26,6 +26,8 @@ pub fn run() -> cosmic::iced::Result { let settings = Settings { initial_surface: InitialSurface::XdgWindow(SctkWindowSettings { size: (32, 32), + autosize: true, + resizable: None, ..Default::default() }), ..Default::default() @@ -96,12 +98,6 @@ impl Application for IcedWorkspacesApplet { Ordering::Greater => Ordering::Greater, }); self.workspaces = list; - let unit = self.helper.suggested_size().0 as u32 + 16; - let (w, h) = match self.layout { - Layout::Row => (unit * self.workspaces.len().max(1) as u32, unit), - Layout::Column => (unit, unit * self.workspaces.len().max(1) as u32), - }; - return resize_window(window::Id(0), w, h); } WorkspacesUpdate::Started(tx) => { self.workspace_tx.replace(tx); @@ -146,8 +142,8 @@ impl Application for IcedWorkspacesApplet { .width(Length::Fill) .height(Length::Fill), ) - .width(Length::Fill) - .height(Length::Fill) + .width(Length::Fixed(self.helper.suggested_size().0 as f32 + 16.0)) + .height(Length::Fixed(self.helper.suggested_size().0 as f32 + 16.0)) .on_press(Message::WorkspacePressed(w.2.clone())) .padding(0); Some( @@ -163,20 +159,20 @@ impl Application for IcedWorkspacesApplet { .collect(); let layout_section: Element<_> = match self.layout { Layout::Row => row(buttons) - .width(Length::Fill) - .height(Length::Fill) + .width(Length::Shrink) + .height(Length::Shrink) .padding(0) .into(), Layout::Column => column(buttons) - .width(Length::Fill) - .height(Length::Fill) + .width(Length::Shrink) + .height(Length::Shrink) .padding(0) .into(), }; container(layout_section) - .width(Length::Fill) - .height(Length::Fill) + .width(Length::Shrink) + .height(Length::Shrink) .padding(0) .into() }