Skip to content

Commit

Permalink
chore: use new singleton mark way
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Nov 29, 2024
1 parent 26c3998 commit ff9f1cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lala_bar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions lala_bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<NotifyUnitWidgetInfo>),
#[singleton]
HiddenInfo,
#[singleton]
RightPanel,
ErrorHappened(iced::window::Id),
#[singleton]
Calendar,
#[singleton]
TimePicker,
}

Expand Down
11 changes: 0 additions & 11 deletions lala_bar/src/music_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::Calendar,
singleton: true,
}),
]);
}
Expand All @@ -643,7 +642,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::Calendar,
singleton: true,
});
}
}
Expand Down Expand Up @@ -671,7 +669,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::TimePicker,
singleton: true,
}),
]);
}
Expand All @@ -687,7 +684,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::TimePicker,
singleton: true,
});
}
}
Expand Down Expand Up @@ -803,7 +799,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::Launcher,
singleton: true,
}),
self.launcher.as_ref().unwrap().focus_input(),
]);
Expand All @@ -830,7 +825,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::Launcher,
singleton: true,
}),
self.launcher.as_ref().unwrap().focus_input(),
]);
Expand All @@ -854,7 +848,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::RightPanel,
singleton: true,
});
}
Message::Notify(NotifyMessage::UnitAdd(notify)) => {
Expand Down Expand Up @@ -936,7 +929,6 @@ impl MultiApplication for LalaMusicBar {
inline_reply: String::new(),
unit: *notify.clone(),
})),
singleton: false,
}));

// NOTE: remove the new one
Expand Down Expand Up @@ -970,7 +962,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::HiddenInfo,
singleton: true,
}));
}

Expand Down Expand Up @@ -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
Expand All @@ -1027,7 +1017,6 @@ impl MultiApplication for LalaMusicBar {
..Default::default()
},
info: LaLaInfo::HiddenInfo,
singleton: true,
}));
}
}
Expand Down

0 comments on commit ff9f1cb

Please sign in to comment.