summaryrefslogtreecommitdiffstats
path: root/native/src/widget/pane_grid/state.rs
diff options
context:
space:
mode:
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,
+ }
}
}