update libcosmic and cleanup theme management (#47)
This commit is contained in:
parent
9e299db491
commit
6e7938b068
2 changed files with 46 additions and 82 deletions
81
Cargo.lock
generated
81
Cargo.lock
generated
|
|
@ -731,7 +731,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"calloop",
|
||||
|
|
@ -746,7 +746,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -874,7 +874,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cosmic-config",
|
||||
|
|
@ -927,22 +927,22 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.14"
|
||||
version = "0.9.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695"
|
||||
checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"memoffset 0.8.0",
|
||||
"memoffset 0.9.0",
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.15"
|
||||
version = "0.8.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b"
|
||||
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
|
@ -2123,7 +2123,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"iced_accessibility",
|
||||
"iced_core",
|
||||
|
|
@ -2139,7 +2139,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_unix",
|
||||
|
|
@ -2148,7 +2148,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2163,7 +2163,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2176,7 +2176,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2193,7 +2193,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2205,7 +2205,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"iced_accessibility",
|
||||
"iced_core",
|
||||
|
|
@ -2217,7 +2217,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_sctk"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"enum-repr",
|
||||
"float-cmp",
|
||||
|
|
@ -2238,7 +2238,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2248,7 +2248,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2266,7 +2266,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.10.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2288,7 +2288,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
|
|
@ -2303,7 +2303,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.9.1"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_runtime",
|
||||
|
|
@ -2540,9 +2540,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.63"
|
||||
version = "0.3.64"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
|
||||
checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
|
@ -2617,7 +2617,7 @@ checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#6699aa475646fd044b5233dc918e3b0e3604c8ed"
|
||||
source = "git+https://github.com/pop-os/libcosmic#a8a2e4ad26fad231db232d3ac2823011e5d31d04"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"cosmic-config",
|
||||
|
|
@ -2638,6 +2638,7 @@ dependencies = [
|
|||
"slotmap",
|
||||
"smithay-client-toolkit 0.17.0",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2769,9 +2770,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
version = "0.8.0"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
|
||||
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
|
@ -4850,9 +4851,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.86"
|
||||
version = "0.2.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
|
||||
checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"wasm-bindgen-macro",
|
||||
|
|
@ -4860,9 +4861,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.86"
|
||||
version = "0.2.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
|
||||
checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log",
|
||||
|
|
@ -4875,9 +4876,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.36"
|
||||
version = "0.4.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e"
|
||||
checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
|
|
@ -4887,9 +4888,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.86"
|
||||
version = "0.2.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
|
||||
checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
|
|
@ -4897,9 +4898,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.86"
|
||||
version = "0.2.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
|
||||
checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -4910,9 +4911,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.86"
|
||||
version = "0.2.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
|
||||
checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-timer"
|
||||
|
|
@ -5107,9 +5108,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.63"
|
||||
version = "0.3.64"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2"
|
||||
checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@ use cosmic_panel_config::CosmicPanelConfig;
|
|||
use cosmic_settings_page::{self as page, section};
|
||||
|
||||
use cosmic::{
|
||||
cosmic_config::{config_subscription, CosmicConfigEntry},
|
||||
cosmic_theme::util::CssColor,
|
||||
cosmic_config::config_subscription,
|
||||
iced::{
|
||||
self,
|
||||
event::wayland::{self, WindowEvent, WindowState},
|
||||
|
|
@ -22,14 +21,13 @@ use cosmic::{
|
|||
iced_sctk::commands::window::{set_mode_window, start_drag_window},
|
||||
iced_style::application,
|
||||
keyboard_nav,
|
||||
theme::{self, Theme},
|
||||
theme::{self, theme_subscription, Theme},
|
||||
widget::{
|
||||
header_bar, nav_bar, nav_bar_toggle, scrollable, search, segmented_button, settings,
|
||||
IconSource,
|
||||
},
|
||||
Element, ElementExt,
|
||||
};
|
||||
use tracing::error;
|
||||
|
||||
use crate::{
|
||||
config::Config,
|
||||
|
|
@ -47,7 +45,7 @@ use crate::{
|
|||
widget::{page_title, parent_page_button, search_header, sub_page_button},
|
||||
};
|
||||
|
||||
use std::{borrow::Cow, process, sync::Arc};
|
||||
use std::{borrow::Cow, process};
|
||||
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
|
|
@ -120,7 +118,7 @@ impl Application for SettingsApp {
|
|||
show_maximize: true,
|
||||
show_minimize: true,
|
||||
window_width: 0,
|
||||
theme: theme(),
|
||||
theme: cosmic::theme::theme(),
|
||||
};
|
||||
|
||||
// app.insert_page::<wifi::Page>();
|
||||
|
|
@ -202,23 +200,7 @@ impl Application for SettingsApp {
|
|||
}
|
||||
},
|
||||
),
|
||||
config_subscription::<u64, cosmic::cosmic_theme::Theme<CssColor>>(
|
||||
0,
|
||||
cosmic::cosmic_theme::NAME.into(),
|
||||
cosmic::cosmic_theme::Theme::<CssColor>::version() as u64,
|
||||
)
|
||||
.map(|(_, res)| {
|
||||
let theme = res.map_or_else(
|
||||
|(errors, theme)| {
|
||||
for err in errors {
|
||||
error!("{:?}", err);
|
||||
}
|
||||
theme.into_srgba()
|
||||
},
|
||||
cosmic::cosmic_theme::Theme::into_srgba,
|
||||
);
|
||||
Message::ThemeChanged(cosmic::theme::Theme::custom(Arc::new(theme)))
|
||||
}),
|
||||
theme_subscription(0).map(Message::ThemeChanged),
|
||||
])
|
||||
}
|
||||
|
||||
|
|
@ -625,22 +607,3 @@ impl SettingsApp {
|
|||
.map(Message::Page)
|
||||
}
|
||||
}
|
||||
|
||||
fn theme() -> Theme {
|
||||
let Ok(helper) = cosmic::cosmic_config::Config::new(
|
||||
cosmic::cosmic_theme::NAME,
|
||||
cosmic::cosmic_theme::Theme::<CssColor>::version() as u64,
|
||||
) else {
|
||||
return cosmic::theme::Theme::dark();
|
||||
};
|
||||
let t = cosmic::cosmic_theme::Theme::get_entry(&helper).map_or_else(
|
||||
|(errors, theme)| {
|
||||
for err in errors {
|
||||
tracing::error!("{:?}", err);
|
||||
}
|
||||
theme.into_srgba()
|
||||
},
|
||||
cosmic::cosmic_theme::Theme::into_srgba,
|
||||
);
|
||||
cosmic::theme::Theme::custom(Arc::new(t))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue