merge: upstream/libcosmic a l'etat pinne par epoch-1.8.0 (d4d71fd53)
# Conflicts: # iced # src/widget/toaster/widget.rs
This commit is contained in:
commit
04848eacce
4 changed files with 32 additions and 21 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 5252095787cc96e2aed64604158f94e450703455
|
||||
Subproject commit 343c007f37cd71716e68f01c43ecf2764b7f7c47
|
||||
2
iced
2
iced
|
|
@ -1 +1 @@
|
|||
Subproject commit e891f34b3224b25fc4bdf286b3f9dba26c8abe5b
|
||||
Subproject commit d12bb8e056712ab87efbdd4296261331772ec413
|
||||
|
|
@ -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!(
|
||||
|
|
|
|||
|
|
@ -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<overlay::Element<'b, Message, Theme, Renderer>> {
|
||||
//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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue