summaryrefslogtreecommitdiffstats
path: root/native/src/widget/pane_grid/state.rs
diff options
context:
space:
mode:
authorLibravatar tarkah <cforsstrom18@gmail.com>2022-11-02 19:25:27 -0700
committerLibravatar tarkah <cforsstrom18@gmail.com>2022-11-02 20:04:16 -0700
commit988515d57f8c67a22ca0554f3e1327b26e5c6ecf (patch)
treefcb147f6de8d7dcae97b8ff99a47fbc229430c27 /native/src/widget/pane_grid/state.rs
parent923878c7b7404739a3f8f2dd86a2e19802fa86de (diff)
downloadiced-988515d57f8c67a22ca0554f3e1327b26e5c6ecf.tar.gz
iced-988515d57f8c67a22ca0554f3e1327b26e5c6ecf.tar.bz2
iced-988515d57f8c67a22ca0554f3e1327b26e5c6ecf.zip
Add state::Scoped & rename Elements as Contents
Diffstat (limited to 'native/src/widget/pane_grid/state.rs')
-rw-r--r--native/src/widget/pane_grid/state.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs
index 92d26f5a..b5bebc2e 100644
--- a/native/src/widget/pane_grid/state.rs
+++ b/native/src/widget/pane_grid/state.rs
@@ -281,6 +281,15 @@ impl Internal {
}
}
+/// The scoped internal state of the [`PaneGrid`]
+#[derive(Debug)]
+pub enum Scoped<'a> {
+ /// The state when all panes are visible
+ All(&'a Internal),
+ /// The state when a pane is maximized
+ Maximized(Node),
+}
+
/// The current action of a [`PaneGrid`].
///
/// [`PaneGrid`]: crate::widget::PaneGrid
@@ -328,9 +337,12 @@ impl Action {
}
}
-impl Internal {
- /// The layout [`Node`] of the [`Internal`] state
+impl<'a> Scoped<'a> {
+ /// The layout [`Node`] of the [`Scope`] state
pub fn layout(&self) -> &Node {
- &self.layout
+ match self {
+ Scoped::All(Internal { layout, .. }) => layout,
+ Scoped::Maximized(layout) => layout,
+ }
}
}