diff options
author | 2021-11-29 16:22:01 +0700 | |
---|---|---|
committer | 2021-11-29 16:22:01 +0700 | |
commit | bbd9355450bc2df3a2c0e37cc900ba00b26255af (patch) | |
tree | a6cf758c934638e3dd9586781dfb62e1cf028572 /native/src/widget/pane_grid | |
parent | f7792d89d64c39cdde9da030bec80fb6f461a0e3 (diff) | |
download | iced-bbd9355450bc2df3a2c0e37cc900ba00b26255af.tar.gz iced-bbd9355450bc2df3a2c0e37cc900ba00b26255af.tar.bz2 iced-bbd9355450bc2df3a2c0e37cc900ba00b26255af.zip |
Introduce `Shell` type in `iced_native`
Widgets now can invalidate the current layout of the application on demand.
Diffstat (limited to 'native/src/widget/pane_grid')
-rw-r--r-- | native/src/widget/pane_grid/content.rs | 10 | ||||
-rw-r--r-- | native/src/widget/pane_grid/title_bar.rs | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/native/src/widget/pane_grid/content.rs b/native/src/widget/pane_grid/content.rs index c44506dd..533827b7 100644 --- a/native/src/widget/pane_grid/content.rs +++ b/native/src/widget/pane_grid/content.rs @@ -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, ) }; diff --git a/native/src/widget/pane_grid/title_bar.rs b/native/src/widget/pane_grid/title_bar.rs index 070cf404..353e1ce9 100644 --- a/native/src/widget/pane_grid/title_bar.rs +++ b/native/src/widget/pane_grid/title_bar.rs @@ -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) |