Add support for getting window id from dialog

This commit is contained in:
Jeremy Soller 2024-07-03 13:14:25 -06:00
parent 1b0dd43d3b
commit 9628642409
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 5 additions and 1 deletions

View file

@ -1036,7 +1036,7 @@ impl Application for App {
),
cosmic::widget::menu::Item::Divider,
if is_context_trash {
cosmic::widget::menu::Item::Button(
cosmic::widget::menu::Item::Button(
fl!("empty-trash"),
NavMenuAction::EmptyTrash,
)

View file

@ -267,6 +267,10 @@ impl<M: Send + 'static> Dialog<M> {
.map(DialogMessage)
.map(self.mapper)
}
pub fn window_id(&self) -> window::Id {
self.cosmic.app.main_window_id()
}
}
#[derive(Clone, Debug)]