Introduce Shell type in iced_native
Widgets now can invalidate the current layout of the application on demand.
This commit is contained in:
parent
f7792d89d6
commit
bbd9355450
26 changed files with 218 additions and 130 deletions
|
|
@ -5,7 +5,9 @@ use crate::overlay;
|
|||
use crate::renderer;
|
||||
use crate::widget::container;
|
||||
use crate::widget::pane_grid::TitleBar;
|
||||
use crate::{Clipboard, Element, Hasher, Layout, Point, Rectangle, Size};
|
||||
use crate::{
|
||||
Clipboard, Element, Hasher, Layout, Point, Rectangle, Shell, Size,
|
||||
};
|
||||
|
||||
/// The content of a [`Pane`].
|
||||
///
|
||||
|
|
@ -160,7 +162,7 @@ where
|
|||
cursor_position: Point,
|
||||
renderer: &Renderer,
|
||||
clipboard: &mut dyn Clipboard,
|
||||
messages: &mut Vec<Message>,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
is_picked: bool,
|
||||
) -> event::Status {
|
||||
let mut event_status = event::Status::Ignored;
|
||||
|
|
@ -174,7 +176,7 @@ where
|
|||
cursor_position,
|
||||
renderer,
|
||||
clipboard,
|
||||
messages,
|
||||
shell,
|
||||
);
|
||||
|
||||
children.next().unwrap()
|
||||
|
|
@ -191,7 +193,7 @@ where
|
|||
cursor_position,
|
||||
renderer,
|
||||
clipboard,
|
||||
messages,
|
||||
shell,
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::overlay;
|
|||
use crate::renderer;
|
||||
use crate::widget::container;
|
||||
use crate::{
|
||||
Clipboard, Element, Hasher, Layout, Padding, Point, Rectangle, Size,
|
||||
Clipboard, Element, Hasher, Layout, Padding, Point, Rectangle, Shell, Size,
|
||||
};
|
||||
|
||||
/// The title bar of a [`Pane`].
|
||||
|
|
@ -218,7 +218,7 @@ where
|
|||
cursor_position: Point,
|
||||
renderer: &Renderer,
|
||||
clipboard: &mut dyn Clipboard,
|
||||
messages: &mut Vec<Message>,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
) -> event::Status {
|
||||
let mut children = layout.children();
|
||||
let padded = children.next().unwrap();
|
||||
|
|
@ -235,7 +235,7 @@ where
|
|||
cursor_position,
|
||||
renderer,
|
||||
clipboard,
|
||||
messages,
|
||||
shell,
|
||||
)
|
||||
} else {
|
||||
event::Status::Ignored
|
||||
|
|
@ -247,7 +247,7 @@ where
|
|||
cursor_position,
|
||||
renderer,
|
||||
clipboard,
|
||||
messages,
|
||||
shell,
|
||||
);
|
||||
|
||||
control_status.merge(title_status)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue