refactor: libcosmic rebase with Application API

This commit is contained in:
Michael Aaron Murphy 2023-09-19 16:54:50 +02:00 committed by Michael Murphy
parent d243e45094
commit 454894d82f
18 changed files with 1081 additions and 1198 deletions

View file

@ -85,6 +85,11 @@ impl<Message: 'static> Binder<Message> {
.and_then(|storage| storage.remove(id));
}
#[must_use]
pub fn find_page_by_id(&self, id: &str) -> Option<(crate::Entity, &Info)> {
self.info.iter().find(|(_id, info)| info.id == id)
}
/// Registers a new page in the settings panel.
pub fn register<P: AutoBind<Message>>(&mut self) -> crate::Insert<Message> {
let page = P::default();