diff --git a/Cargo.lock b/Cargo.lock index e8dc34d..71342eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1934,9 +1934,9 @@ dependencies = [ [[package]] name = "iced_layershell" -version = "0.10.1" +version = "0.11.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85edc89e67bbf34a39bdd57a4de810599801ff6e130a0bb9a3804ab69036cc0" +checksum = "e99112e3f418c824d77fa2a67cb9765beb0ace159211d0f658cd67987408fe9d" dependencies = [ "futures", "iced", @@ -1955,9 +1955,9 @@ dependencies = [ [[package]] name = "iced_layershell_macros" -version = "0.10.1" +version = "0.11.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1af4664088e50f9328d7e01818ac460de2ff76f5a0aa7bae6da4617056104415" +checksum = "5b71edd0d706986c796e8bf9c109bd5fe874c34d0f5d1f90955596def71be571" dependencies = [ "darling", "manyhow", @@ -2417,9 +2417,9 @@ dependencies = [ [[package]] name = "layershellev" -version = "0.10.1" +version = "0.11.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172cfce9b133ad3459ea0c6f1c84c8506e62432b81a2eebddd0f2e6579314181" +checksum = "95f645071d95d5519de60b0160db1f84919df703d293c23b49c52eeebedf20bc" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", @@ -4605,9 +4605,9 @@ dependencies = [ [[package]] name = "waycrate_xkbkeycode" -version = "0.10.1" +version = "0.11.0-rc2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fecfbfc7535a542425651215091818bb29a829ea1e65161852218d50449a24" +checksum = "588bab8a40605e345965fbd56cf3187a280ea9aedb22ceed94707dbe6fad3138" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", diff --git a/lala_bar/Cargo.toml b/lala_bar/Cargo.toml index 9b1d78a..b4295bc 100644 --- a/lala_bar/Cargo.toml +++ b/lala_bar/Cargo.toml @@ -21,7 +21,7 @@ iced = { version = "0.13.1", features = [ "markdown", ] } iced_runtime = "0.13.2" -iced_layershell = "0.10.1" +iced_layershell = "0.11.0-rc2" tokio = { version = "1.41", features = ["full"] } iced_futures = "0.13.2" env_logger = "0.11.5" diff --git a/lala_bar/src/main.rs b/lala_bar/src/main.rs index cf105de..b861569 100644 --- a/lala_bar/src/main.rs +++ b/lala_bar/src/main.rs @@ -9,8 +9,8 @@ use iced_aw::date_picker::Date; use iced_aw::time_picker::Time; use iced_layershell::reexport::{Anchor, Layer}; use iced_layershell::settings::{LayerShellSettings, Settings, StartMode}; -use iced_layershell::to_layer_message; use iced_layershell::MultiApplication; +use iced_layershell::{to_layer_message, LayerSingleton}; mod aximer; mod config; @@ -50,14 +50,19 @@ pub fn main() -> Result<(), iced_layershell::Error> { }) } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, LayerSingleton)] pub enum LaLaInfo { + #[singleton] Launcher, Notify(Box), + #[singleton] HiddenInfo, + #[singleton] RightPanel, ErrorHappened(iced::window::Id), + #[singleton] Calendar, + #[singleton] TimePicker, } diff --git a/lala_bar/src/music_bar.rs b/lala_bar/src/music_bar.rs index fab82f5..c84bc9c 100644 --- a/lala_bar/src/music_bar.rs +++ b/lala_bar/src/music_bar.rs @@ -627,7 +627,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::Calendar, - singleton: true, }), ]); } @@ -643,7 +642,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::Calendar, - singleton: true, }); } } @@ -671,7 +669,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::TimePicker, - singleton: true, }), ]); } @@ -687,7 +684,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::TimePicker, - singleton: true, }); } } @@ -803,7 +799,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::Launcher, - singleton: true, }), self.launcher.as_ref().unwrap().focus_input(), ]); @@ -830,7 +825,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::Launcher, - singleton: true, }), self.launcher.as_ref().unwrap().focus_input(), ]); @@ -854,7 +848,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::RightPanel, - singleton: true, }); } Message::Notify(NotifyMessage::UnitAdd(notify)) => { @@ -936,7 +929,6 @@ impl MultiApplication for LalaMusicBar { inline_reply: String::new(), unit: *notify.clone(), })), - singleton: false, })); // NOTE: remove the new one @@ -970,7 +962,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::HiddenInfo, - singleton: true, })); } @@ -1009,7 +1000,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::Notify(Box::new(notify_info.clone())), - singleton: false, })); } if self.notifications.len() > MAX_SHOWN_NOTIFICATIONS_COUNT @@ -1027,7 +1017,6 @@ impl MultiApplication for LalaMusicBar { ..Default::default() }, info: LaLaInfo::HiddenInfo, - singleton: true, })); } }