From 91e920e780a4f8008e38f01a308bdbbb32f051ac Mon Sep 17 00:00:00 2001 From: Bryan Hyland Date: Tue, 19 Nov 2024 14:21:55 -0800 Subject: [PATCH 1/4] Updated appearance spin_button for updated API --- .../src/pages/desktop/appearance/mod.rs | 82 ++++++++++--------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index a612d1a8..8b85570a 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -17,14 +17,14 @@ use cosmic::cosmic_theme::{ CornerRadii, Density, Spacing, Theme, ThemeBuilder, ThemeMode, DARK_THEME_BUILDER_ID, LIGHT_THEME_BUILDER_ID, }; -use cosmic::iced_core::{Alignment, Color, Length}; +use cosmic::iced_core::{alignment, Color, Length}; use cosmic::iced_widget::scrollable::{Direction, Scrollbar}; use cosmic::widget::icon::{from_name, icon}; use cosmic::widget::{ button, color_picker::ColorPickerUpdate, container, flex_row, horizontal_space, radio, row, scrollable, settings, spin_button, text, ColorPickerModel, }; -use cosmic::{widget, Apply, Element, Task}; +use cosmic::{Apply, Element, Task}; #[cfg(feature = "wayland")] use cosmic_panel_config::CosmicPanelConfig; use cosmic_settings_page::Section; @@ -286,7 +286,7 @@ pub enum Message { FontConfig(font_config::Message), FontSearch(String), FontSelect(bool, Arc), - GapSize(spin_button::Message), + GapSize(i32), IconTheme(usize), #[cfg(feature = "ashpd")] ImportError, @@ -305,7 +305,7 @@ pub enum Message { #[cfg(feature = "ashpd")] StartImport, UseDefaultWindowHint(bool), - WindowHintSize(spin_button::Message), + WindowHintSize(i32), Daytime(bool), } @@ -551,32 +551,23 @@ impl Page { } } - Message::WindowHintSize(msg) => { + Message::WindowHintSize(active_hint) => { needs_sync = true; let Some(config) = self.theme_builder_config.as_ref() else { return Task::none(); }; - let active_hint = match msg { - spin_button::Message::Increment => { - self.theme_builder.active_hint.saturating_add(1) - } - spin_button::Message::Decrement => { - self.theme_builder.active_hint.saturating_sub(1) - } - }; - if self .theme_builder - .set_active_hint(config, active_hint) + .set_active_hint(config, active_hint as u32) .unwrap_or_default() { self.theme_config_write("active_hint", active_hint); } } - Message::GapSize(msg) => { + Message::GapSize(new_gap_size) => { needs_sync = true; let Some(config) = self.theme_builder_config.as_ref() else { @@ -585,10 +576,7 @@ impl Page { let mut gaps = self.theme_builder.gaps; - gaps.1 = match msg { - spin_button::Message::Increment => self.theme_builder.gaps.1.saturating_add(1), - spin_button::Message::Decrement => self.theme_builder.gaps.1.saturating_sub(1), - }; + gaps.1 = new_gap_size as u32; if self .theme_builder @@ -1319,6 +1307,8 @@ impl Page { // TODO: cache panel and dock configs so that they needn't be re-read #[cfg(feature = "wayland")] fn update_panel_radii(roundness: Roundness) { + use cosmic_config::CosmicConfigEntry; + let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok(); let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); @@ -1365,6 +1355,8 @@ impl Page { #[cfg(feature = "wayland")] fn update_panel_spacing(density: Density) { + use cosmic_config::CosmicConfigEntry; + let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok(); let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); let mut panel_config = panel_config_helper.as_ref().and_then(|config_helper| { @@ -1431,7 +1423,7 @@ impl page::Page for Page { .push(button::standard(fl!("export")).on_press(Message::StartExport)) .apply(container) .width(Length::Fill) - .align_x(Alignment::End) + .align_x(alignment::Horizontal::Right) .apply(Element::from) .map(crate::pages::Message::Appearance); @@ -1609,7 +1601,7 @@ pub fn mode_and_colors() -> Section { ] .spacing(space_xxs) .width(Length::FillPortion(1)) - .align_x(Alignment::Center), + .align_x(cosmic::iced_core::Alignment::Center), cosmic::iced::widget::column![ button::custom( icon(light_mode_illustration.clone(),) @@ -1624,13 +1616,14 @@ pub fn mode_and_colors() -> Section { ] .spacing(space_xxs) .width(Length::FillPortion(1)) - .align_x(Alignment::Center) + .align_x(cosmic::iced_core::Alignment::Center) ] .spacing(48) - .align_y(Alignment::Center) + .align_y(cosmic::iced_core::Alignment::Center) .width(Length::Fixed(424.0)), ) - .center_x(Length::Fill), + .width(Length::Fill) + .align_x(cosmic::iced_core::alignment::Horizontal::Center), ) .add( settings::item::builder(&descriptions[auto_switch]) @@ -1863,7 +1856,7 @@ pub fn style() -> Section { ] .spacing(8) .width(Length::FillPortion(1)) - .align_x(Alignment::Center), + .align_x(cosmic::iced_core::Alignment::Center), cosmic::iced::widget::column![ button::custom( icon( @@ -1885,7 +1878,7 @@ pub fn style() -> Section { ] .spacing(8) .width(Length::FillPortion(1)) - .align_x(Alignment::Center), + .align_x(cosmic::iced_core::Alignment::Center), cosmic::iced::widget::column![ button::custom( icon( @@ -1907,14 +1900,15 @@ pub fn style() -> Section { text::body(&descriptions[square]) ] .spacing(8) - .align_x(Alignment::Center) + .align_x(cosmic::iced_core::Alignment::Center) .width(Length::FillPortion(1)) ] .spacing(12) .width(Length::Fixed(628.0)) - .align_y(Alignment::Center), + .align_y(cosmic::iced_core::Alignment::Center), ) - .center_x(Length::Fill), + .width(Length::Fill) + .align_x(cosmic::iced_core::alignment::Horizontal::Center), ) .apply(Element::from) .map(crate::pages::Message::Appearance) @@ -1982,18 +1976,26 @@ pub fn window_management() -> Section { settings::section() .title(§ion.title) - .add(settings::item::builder(&descriptions[active_hint]).control( - cosmic::widget::spin_button( - page.theme_builder.active_hint.to_string(), + .add( + settings::item::builder(&descriptions[active_hint]).control(spin_button( + page.theme.active_hint.to_string(), + 1, + page.theme.active_hint as i32, + 0, + 500, Message::WindowHintSize, - ), - )) - .add(settings::item::builder(&descriptions[gaps]).control( - cosmic::widget::spin_button( - page.theme_builder.gaps.1.to_string(), + )), + ) + .add( + settings::item::builder(&descriptions[gaps]).control(spin_button( + page.theme.gaps.1.to_string(), + 1, + page.theme.gaps.1 as i32, + 0, + 500, Message::GapSize, - ), - )) + )), + ) .apply(Element::from) .map(crate::pages::Message::Appearance) }) From 1742c3afc8fd40438a06dc4a77d32175fe537caa Mon Sep 17 00:00:00 2001 From: Bryan Hyland Date: Tue, 19 Nov 2024 14:39:54 -0800 Subject: [PATCH 2/4] Updated spin_button changes --- .../src/pages/desktop/appearance/mod.rs | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index 8b85570a..e5b0eeb7 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -17,14 +17,14 @@ use cosmic::cosmic_theme::{ CornerRadii, Density, Spacing, Theme, ThemeBuilder, ThemeMode, DARK_THEME_BUILDER_ID, LIGHT_THEME_BUILDER_ID, }; -use cosmic::iced_core::{alignment, Color, Length}; +use cosmic::iced_core::{Alignment, Color, Length}; use cosmic::iced_widget::scrollable::{Direction, Scrollbar}; use cosmic::widget::icon::{from_name, icon}; use cosmic::widget::{ button, color_picker::ColorPickerUpdate, container, flex_row, horizontal_space, radio, row, scrollable, settings, spin_button, text, ColorPickerModel, }; -use cosmic::{Apply, Element, Task}; +use cosmic::{widget, Apply, Element, Task}; #[cfg(feature = "wayland")] use cosmic_panel_config::CosmicPanelConfig; use cosmic_settings_page::Section; @@ -286,7 +286,7 @@ pub enum Message { FontConfig(font_config::Message), FontSearch(String), FontSelect(bool, Arc), - GapSize(i32), + GapSize(u32), IconTheme(usize), #[cfg(feature = "ashpd")] ImportError, @@ -305,7 +305,7 @@ pub enum Message { #[cfg(feature = "ashpd")] StartImport, UseDefaultWindowHint(bool), - WindowHintSize(i32), + WindowHintSize(u32), Daytime(bool), } @@ -560,14 +560,14 @@ impl Page { if self .theme_builder - .set_active_hint(config, active_hint as u32) + .set_active_hint(config, active_hint) .unwrap_or_default() { self.theme_config_write("active_hint", active_hint); } } - Message::GapSize(new_gap_size) => { + Message::GapSize(gap) => { needs_sync = true; let Some(config) = self.theme_builder_config.as_ref() else { @@ -576,7 +576,7 @@ impl Page { let mut gaps = self.theme_builder.gaps; - gaps.1 = new_gap_size as u32; + gaps.1 = gap; if self .theme_builder @@ -1307,8 +1307,6 @@ impl Page { // TODO: cache panel and dock configs so that they needn't be re-read #[cfg(feature = "wayland")] fn update_panel_radii(roundness: Roundness) { - use cosmic_config::CosmicConfigEntry; - let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok(); let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); @@ -1355,8 +1353,6 @@ impl Page { #[cfg(feature = "wayland")] fn update_panel_spacing(density: Density) { - use cosmic_config::CosmicConfigEntry; - let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok(); let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); let mut panel_config = panel_config_helper.as_ref().and_then(|config_helper| { @@ -1423,7 +1419,7 @@ impl page::Page for Page { .push(button::standard(fl!("export")).on_press(Message::StartExport)) .apply(container) .width(Length::Fill) - .align_x(alignment::Horizontal::Right) + .align_x(Alignment::End) .apply(Element::from) .map(crate::pages::Message::Appearance); @@ -1601,7 +1597,7 @@ pub fn mode_and_colors() -> Section { ] .spacing(space_xxs) .width(Length::FillPortion(1)) - .align_x(cosmic::iced_core::Alignment::Center), + .align_x(Alignment::Center), cosmic::iced::widget::column![ button::custom( icon(light_mode_illustration.clone(),) @@ -1616,14 +1612,13 @@ pub fn mode_and_colors() -> Section { ] .spacing(space_xxs) .width(Length::FillPortion(1)) - .align_x(cosmic::iced_core::Alignment::Center) + .align_x(Alignment::Center) ] .spacing(48) - .align_y(cosmic::iced_core::Alignment::Center) + .align_y(Alignment::Center) .width(Length::Fixed(424.0)), ) - .width(Length::Fill) - .align_x(cosmic::iced_core::alignment::Horizontal::Center), + .center_x(Length::Fill), ) .add( settings::item::builder(&descriptions[auto_switch]) @@ -1856,7 +1851,7 @@ pub fn style() -> Section { ] .spacing(8) .width(Length::FillPortion(1)) - .align_x(cosmic::iced_core::Alignment::Center), + .align_x(Alignment::Center), cosmic::iced::widget::column![ button::custom( icon( @@ -1878,7 +1873,7 @@ pub fn style() -> Section { ] .spacing(8) .width(Length::FillPortion(1)) - .align_x(cosmic::iced_core::Alignment::Center), + .align_x(Alignment::Center), cosmic::iced::widget::column![ button::custom( icon( @@ -1900,15 +1895,14 @@ pub fn style() -> Section { text::body(&descriptions[square]) ] .spacing(8) - .align_x(cosmic::iced_core::Alignment::Center) + .align_x(Alignment::Center) .width(Length::FillPortion(1)) ] .spacing(12) .width(Length::Fixed(628.0)) - .align_y(cosmic::iced_core::Alignment::Center), + .align_y(Alignment::Center), ) - .width(Length::Fill) - .align_x(cosmic::iced_core::alignment::Horizontal::Center), + .center_x(Length::Fill), ) .apply(Element::from) .map(crate::pages::Message::Appearance) @@ -1976,26 +1970,26 @@ pub fn window_management() -> Section { settings::section() .title(§ion.title) - .add( - settings::item::builder(&descriptions[active_hint]).control(spin_button( - page.theme.active_hint.to_string(), + .add(settings::item::builder(&descriptions[active_hint]).control( + cosmic::widget::spin_button( + page.theme_builder.active_hint.to_string(), 1, - page.theme.active_hint as i32, + page.theme.active_hint, 0, 500, Message::WindowHintSize, - )), - ) - .add( - settings::item::builder(&descriptions[gaps]).control(spin_button( - page.theme.gaps.1.to_string(), + ), + )) + .add(settings::item::builder(&descriptions[gaps]).control( + cosmic::widget::spin_button( + page.theme_builder.gaps.1.to_string(), + page.theme_builder.gaps.1.to_string(), 1, - page.theme.gaps.1 as i32, - 0, + page.theme.active_hint, 500, Message::GapSize, - )), - ) + ), + )) .apply(Element::from) .map(crate::pages::Message::Appearance) }) @@ -2084,4 +2078,4 @@ pub fn color_button<'a, Message: 'a + Clone>( .width(Length::Fixed(f32::from(width))) .height(Length::Fixed(f32::from(height))) .into() -} +} \ No newline at end of file From 179c3df5b38df4280444ad6327debfb5b648ee93 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 20 Nov 2024 12:11:50 -0500 Subject: [PATCH 3/4] fix: spin button --- cosmic-settings/src/pages/desktop/appearance/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index e5b0eeb7..01933a37 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -1983,7 +1983,7 @@ pub fn window_management() -> Section { .add(settings::item::builder(&descriptions[gaps]).control( cosmic::widget::spin_button( page.theme_builder.gaps.1.to_string(), - page.theme_builder.gaps.1.to_string(), + page.theme_builder.gaps.1, 1, page.theme.active_hint, 500, @@ -2078,4 +2078,4 @@ pub fn color_button<'a, Message: 'a + Clone>( .width(Length::Fixed(f32::from(width))) .height(Length::Fixed(f32::from(height))) .into() -} \ No newline at end of file +} From c8230e10cf0d63a52a8a64ba61c19fcea5939e68 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 20 Nov 2024 12:30:50 -0500 Subject: [PATCH 4/4] update libcosmic --- Cargo.lock | 199 ++++++++++++++----------------------- cosmic-settings/src/app.rs | 21 +++- 2 files changed, 93 insertions(+), 127 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62d7f077..c9ca5b43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -494,7 +494,7 @@ dependencies = [ "futures-lite 2.5.0", "parking", "polling 3.7.4", - "rustix 0.38.40", + "rustix 0.38.41", "slab", "tracing", "windows-sys 0.59.0", @@ -544,7 +544,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.40", + "rustix 0.38.41", "windows-sys 0.48.0", ] @@ -563,7 +563,7 @@ dependencies = [ "cfg-if", "event-listener 5.3.1", "futures-lite 2.5.0", - "rustix 0.38.40", + "rustix 0.38.41", "tracing", ] @@ -590,7 +590,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.40", + "rustix 0.38.41", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -624,7 +624,7 @@ name = "atomicwrites" version = "0.4.2" source = "git+https://github.com/jackpot51/rust-atomicwrites#043ab4859d53ffd3d55334685303d8df39c9f768" dependencies = [ - "rustix 0.38.40", + "rustix 0.38.41", "tempfile", "windows-sys 0.48.0", ] @@ -867,9 +867,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5327f6c99920069d1fe374aa743be1af0031dea9f250852cdf1ae6a0861ee24" +checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" dependencies = [ "borsh-derive", "cfg_aliases 0.2.1", @@ -877,9 +877,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10aedd8f1a81a8aafbfde924b0e3061cd6fedd6f6bbcfc6a76e6fd426d7bfe26" +checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" dependencies = [ "once_cell", "proc-macro-crate 3.2.0", @@ -941,9 +941,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" +checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" dependencies = [ "bytemuck_derive", ] @@ -996,7 +996,7 @@ dependencies = [ "bitflags 2.6.0", "log", "polling 3.7.4", - "rustix 0.38.40", + "rustix 0.38.41", "slab", "thiserror", ] @@ -1008,16 +1008,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ "calloop", - "rustix 0.38.40", + "rustix 0.38.41", "wayland-backend", "wayland-client", ] [[package]] name = "cc" -version = "1.1.37" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", @@ -1106,9 +1106,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -1116,9 +1116,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -1140,9 +1140,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "clipboard-win" @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "cosmic-comp-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-comp#641bb75eb1a6449752d14b9776381a823999b85e" +source = "git+https://github.com/pop-os/cosmic-comp#7e8cb91d2353538a561c58620204f5b4a9a5ccff" dependencies = [ "cosmic-config", "input", @@ -1471,7 +1471,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "quote", "syn 1.0.109", @@ -1516,7 +1516,7 @@ dependencies = [ [[package]] name = "cosmic-idle-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-idle#08c1cf318e91831b6cbfd2c94d2fafbedb90919f" +source = "git+https://github.com/pop-os/cosmic-idle#eaa09a6fef304ddc236709c111bb7b0c16883f7d" dependencies = [ "cosmic-config", "serde", @@ -1525,7 +1525,7 @@ dependencies = [ [[package]] name = "cosmic-panel-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-panel#d0d79726307405cdf2d879d3fb6162a8b2f5996a" +source = "git+https://github.com/pop-os/cosmic-panel#fd840c31c302c616146c28f7b008a91c5694baf6" dependencies = [ "anyhow", "cosmic-config", @@ -1696,7 +1696,7 @@ dependencies = [ "libpulse-binding", "log", "pipewire", - "rustix 0.38.40", + "rustix 0.38.41", "secure-string", "thiserror", "tokio", @@ -1764,7 +1764,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "almost", "cosmic-config", @@ -1780,9 +1780,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -2172,7 +2172,7 @@ dependencies = [ "bytemuck", "drm-ffi", "drm-fourcc", - "rustix 0.38.40", + "rustix 0.38.41", ] [[package]] @@ -2182,7 +2182,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" dependencies = [ "drm-sys", - "rustix 0.38.40", + "rustix 0.38.41", ] [[package]] @@ -2415,9 +2415,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -2567,16 +2567,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fraction" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f158e3ff0a1b334408dc9fb811cd99b446986f4d8b741bb08f9df1604085ae7" -dependencies = [ - "lazy_static", - "num", -] - [[package]] name = "freedesktop-desktop-entry" version = "0.7.5" @@ -3149,7 +3139,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "dnd", "iced_accessibility", @@ -3167,7 +3157,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "accesskit", "accesskit_winit", @@ -3176,7 +3166,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "bitflags 2.6.0", "bytes", @@ -3201,7 +3191,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "futures", "iced_core", @@ -3227,7 +3217,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "bitflags 2.6.0", "bytemuck", @@ -3249,7 +3239,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -3261,7 +3251,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "bytes", "dnd", @@ -3277,7 +3267,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "bytemuck", "cosmic-text", @@ -3293,7 +3283,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "as-raw-xcb-connection", "bitflags 2.6.0", @@ -3309,7 +3299,7 @@ dependencies = [ "raw-window-handle", "resvg", "rustc-hash 2.0.0", - "rustix 0.38.40", + "rustix 0.38.41", "smithay-client-toolkit", "thiserror", "tiny-xlib", @@ -3324,7 +3314,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "dnd", "iced_accessibility", @@ -3343,7 +3333,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "dnd", "iced_accessibility", @@ -4019,9 +4009,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "7a73e9fe3c49d7afb2ace819fa181a287ce54a0983eda4e0eb05c22f82ffe534" [[package]] name = "jni" @@ -4319,14 +4309,14 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#aaadf7199ebed8a5a04ebed559f62455d622689e" +source = "git+https://github.com/pop-os/libcosmic#525a14cfb1a735779a9fe970ff1726c8dbf1b217" dependencies = [ "apply", "ashpd 0.9.2", @@ -4337,7 +4327,6 @@ dependencies = [ "cosmic-theme", "css-color", "derive_setters", - "fraction", "freedesktop-icons", "iced", "iced_accessibility", @@ -4941,20 +4930,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -4965,15 +4940,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -5011,17 +4977,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -5657,7 +5612,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.40", + "rustix 0.38.41", "tracing", "windows-sys 0.59.0", ] @@ -5762,7 +5717,7 @@ dependencies = [ "hex", "lazy_static", "procfs-core", - "rustix 0.38.40", + "rustix 0.38.41", ] [[package]] @@ -6276,9 +6231,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -6383,9 +6338,9 @@ checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -6404,9 +6359,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -6415,9 +6370,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "indexmap 2.6.0", "itoa", @@ -6613,7 +6568,7 @@ dependencies = [ "log", "memmap2 0.9.5", "pkg-config", - "rustix 0.38.40", + "rustix 0.38.41", "thiserror", "wayland-backend", "wayland-client", @@ -6685,7 +6640,7 @@ dependencies = [ "objc", "raw-window-handle", "redox_syscall 0.4.1", - "rustix 0.38.40", + "rustix 0.38.41", "tiny-xlib", "wasm-bindgen", "wayland-backend", @@ -6871,7 +6826,7 @@ dependencies = [ [[package]] name = "system" version = "0.1.0" -source = "git+https://github.com/serpent-os/lichen#d09e89773d5051a3c6603cd5ef7444183dd2451c" +source = "git+https://github.com/serpent-os/lichen#f44a7c9e6faf48407d5d60b836517f40bae7b98b" dependencies = [ "fs-err", "futures", @@ -6948,7 +6903,7 @@ dependencies = [ "cfg-if", "fastrand 2.2.0", "once_cell", - "rustix 0.38.40", + "rustix 0.38.41", "windows-sys 0.59.0", ] @@ -6963,9 +6918,9 @@ dependencies = [ [[package]] name = "textdistance" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1835c76a9d443834c04539860f3ce46b9d93ef8c260057f939e967ca81180a" +checksum = "aa672c55ab69f787dbc9126cc387dbe57fdd595f585e4524cf89018fa44ab819" [[package]] name = "thiserror" @@ -7395,9 +7350,9 @@ checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-linebreak" @@ -7683,7 +7638,7 @@ checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" dependencies = [ "cc", "downcast-rs", - "rustix 0.38.40", + "rustix 0.38.41", "scoped-tls", "smallvec", "wayland-sys", @@ -7696,7 +7651,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ "bitflags 2.6.0", - "rustix 0.38.40", + "rustix 0.38.41", "wayland-backend", "wayland-scanner", ] @@ -7718,7 +7673,7 @@ version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b08bc3aafdb0035e7fe0fdf17ba0c09c268732707dca4ae098f60cb28c9e4c" dependencies = [ - "rustix 0.38.40", + "rustix 0.38.41", "wayland-client", "xcursor", ] @@ -7783,7 +7738,7 @@ dependencies = [ "bitflags 2.6.0", "downcast-rs", "io-lifetimes 2.0.3", - "rustix 0.38.40", + "rustix 0.38.41", "wayland-backend", "wayland-scanner", ] @@ -7960,7 +7915,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -8354,7 +8309,7 @@ dependencies = [ "pin-project", "raw-window-handle", "redox_syscall 0.4.1", - "rustix 0.38.40", + "rustix 0.38.41", "sctk-adwaita", "smithay-client-toolkit", "smol_str", @@ -8438,7 +8393,7 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 0.38.40", + "rustix 0.38.41", "x11rb-protocol", ] @@ -8473,7 +8428,7 @@ dependencies = [ [[package]] name = "xdg-shell-wrapper-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-panel#d0d79726307405cdf2d879d3fb6162a8b2f5996a" +source = "git+https://github.com/pop-os/cosmic-panel#fd840c31c302c616146c28f7b008a91c5694baf6" dependencies = [ "serde", "wayland-protocols-wlr", diff --git a/cosmic-settings/src/app.rs b/cosmic-settings/src/app.rs index 6e9a5246..c725d2f8 100644 --- a/cosmic-settings/src/app.rs +++ b/cosmic-settings/src/app.rs @@ -18,6 +18,7 @@ use crate::subscription::desktop_files; use crate::widget::{page_title, search_header}; use crate::PageCommands; use cosmic::app::command::set_theme; +use cosmic::app::context_drawer::ContextDrawer; #[cfg(feature = "single-instance")] use cosmic::app::DbusActivationMessage; #[cfg(feature = "wayland")] @@ -68,6 +69,7 @@ pub struct SettingsApp { search_id: cosmic::widget::Id, search_input: String, search_selections: Vec<(page::Entity, section::Entity)>, + context_title: Option, } impl SettingsApp { @@ -183,6 +185,7 @@ impl cosmic::Application for SettingsApp { search_id: cosmic::widget::Id::unique(), search_input: String::new(), search_selections: Vec::default(), + context_title: None, }; #[cfg(feature = "page-networking")] @@ -696,7 +699,7 @@ impl cosmic::Application for SettingsApp { Message::OpenContextDrawer(page, title) => { self.core.window.show_context = true; self.active_context_page = Some(page); - self.set_context_title(title.to_string()); + self.context_title = Some(title.to_string()); } Message::CloseContextDrawer => { @@ -761,12 +764,20 @@ impl cosmic::Application for SettingsApp { panic!("unknown window ID: {id:?}"); } - fn context_drawer(&self) -> Option> { + fn context_drawer(&self) -> Option> { if self.core.window.show_context { self.active_context_page.and_then(|context_page| { - self.pages - .context_drawer(context_page) - .map(|e| e.map(Message::PageMessage)) + self.pages.context_drawer(context_page).map(|cd| { + let cd = cosmic::app::context_drawer::context_drawer( + cd.map(Message::PageMessage), + Message::CloseContextDrawer, + ); + if let Some(title) = self.context_title.as_ref() { + cd.title(title) + } else { + cd + } + }) }) } else { None