feat: inner-app dialog API support

This commit is contained in:
Michael Aaron Murphy 2024-03-27 16:01:35 +01:00 committed by Michael Murphy
parent 43b478ee68
commit 29f0489c8a
3 changed files with 23 additions and 2 deletions

View file

@ -60,7 +60,6 @@ impl SettingsApp {
PageCommands::DesktopPanel => self.pages.page_id::<desktop::options::Page>(),
PageCommands::Displays => self.pages.page_id::<display::Page>(),
PageCommands::Firmware => self.pages.page_id::<system::firmware::Page>(),
PageCommands::Keyboard => self.pages.page_id::<input::keyboard::Page>(),
PageCommands::Mouse => self.pages.page_id::<input::mouse::Page>(),
PageCommands::Network => None,
PageCommands::Notifications => self.pages.page_id::<desktop::notifications::Page>(),
@ -529,6 +528,12 @@ impl cosmic::Application for SettingsApp {
None
}
}
fn dialog(&self) -> Option<Element<Self::Message>> {
self.pages
.dialog(self.active_page)
.map(|e| e.map(Message::PageMessage))
}
}
impl SettingsApp {