diff --git a/cosmic-icons b/cosmic-icons index 52520957..343c007f 160000 --- a/cosmic-icons +++ b/cosmic-icons @@ -1 +1 @@ -Subproject commit 5252095787cc96e2aed64604158f94e450703455 +Subproject commit 343c007f37cd71716e68f01c43ecf2764b7f7c47 diff --git a/iced b/iced index e891f34b..d12bb8e0 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit e891f34b3224b25fc4bdf286b3f9dba26c8abe5b +Subproject commit d12bb8e056712ab87efbdd4296261331772ec413 diff --git a/src/widget/popover.rs b/src/widget/popover.rs index b9704244..fb7fea66 100644 --- a/src/widget/popover.rs +++ b/src/widget/popover.rs @@ -157,9 +157,17 @@ where ) { if self.popup.is_some() { if self.modal { - if matches!(event, Event::Mouse(_) | Event::Touch(_)) { - shell.capture_event(); - return; + match event { + Event::Mouse(_) | Event::Touch(_) => { + shell.capture_event(); + return; + } + // app-level keyboard navigation (Tab focus cycling, Escape) + // still receives keyboard events + Event::Keyboard(_) => { + return; + } + _ => {} } } else if let Some(on_close) = self.on_close.as_ref() && matches!( diff --git a/src/widget/toaster/widget.rs b/src/widget/toaster/widget.rs index 03bdf1bd..63c1c6a2 100644 --- a/src/widget/toaster/widget.rs +++ b/src/widget/toaster/widget.rs @@ -4,7 +4,7 @@ use iced::{Limits, Size}; use iced_core::layout::Node; -use iced_core::event::Event; +use iced_core::event::{self, Event}; use iced_core::renderer::{self}; use iced_core::widget::Operation; use iced_core::widget::tree::Tree; @@ -142,23 +142,26 @@ where viewport: &Rectangle, translation: Vector, ) -> Option> { - //TODO: this hides the overlay of the content during the toast + let (content_state, toasts_state) = state.children.split_at_mut(1); + let content = self.content.as_widget_mut().overlay( + &mut content_state[0], + layout, + renderer, + viewport, + translation, + ); if self.is_empty { - self.content.as_widget_mut().overlay( - &mut state.children[0], - layout, - renderer, - viewport, - translation, - ) - } else { - let _bounds = layout.bounds(); - - Some(overlay::Element::new(Box::new(ToasterOverlay::new( - &mut state.children[1], - &mut self.toasts, - )))) + return content; } + // keep the content's overlays (e.g. popovers, menus) visible while a toast is shown + let toaster = overlay::Element::new(Box::new(ToasterOverlay::new( + &mut toasts_state[0], + &mut self.toasts, + ))); + Some(match content { + Some(content) => overlay::Group::with_children(vec![content, toaster]).overlay(), + None => toaster, + }) } fn drag_destinations(