summaryrefslogtreecommitdiffstats
path: root/native/src/widget/pane_grid/content.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-05-25 20:34:10 +0200
committerLibravatar GitHub <noreply@github.com>2020-05-25 20:34:10 +0200
commit5324eb10242a7dd33f5271dc6fc9eeb09eb2cb50 (patch)
tree55ba66173ef8b5c34784945609daf5b6dc77d6aa /native/src/widget/pane_grid/content.rs
parent33448508a524db6447b380cc236be6f0d5ca8a86 (diff)
parent230bd6f7475752352ca9985802db0633e3508d9f (diff)
downloadiced-5324eb10242a7dd33f5271dc6fc9eeb09eb2cb50.tar.gz
iced-5324eb10242a7dd33f5271dc6fc9eeb09eb2cb50.tar.bz2
iced-5324eb10242a7dd33f5271dc6fc9eeb09eb2cb50.zip
Merge pull request #358 from hecrj/improvement/pane-grid-ergonomics
Implement `State::layout` and `State::with_content` in `pane_grid`
Diffstat (limited to 'native/src/widget/pane_grid/content.rs')
-rw-r--r--native/src/widget/pane_grid/content.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/native/src/widget/pane_grid/content.rs b/native/src/widget/pane_grid/content.rs
new file mode 100644
index 00000000..8822083e
--- /dev/null
+++ b/native/src/widget/pane_grid/content.rs
@@ -0,0 +1,30 @@
+use crate::pane_grid::Axis;
+
+/// The content of a [`PaneGrid`].
+///
+/// [`PaneGrid`]: struct.PaneGrid.html
+#[derive(Debug, Clone)]
+pub enum Content<T> {
+ /// A split of the available space.
+ Split {
+ /// The direction of the split.
+ axis: Axis,
+
+ /// The ratio of the split in [0.0, 1.0].
+ ratio: f32,
+
+ /// The left/top [`Content`] of the split.
+ ///
+ /// [`Content`]: enum.Node.html
+ a: Box<Content<T>>,
+
+ /// The right/bottom [`Content`] of the split.
+ ///
+ /// [`Content`]: enum.Node.html
+ b: Box<Content<T>>,
+ },
+ /// A [`Pane`].
+ ///
+ /// [`Pane`]: struct.Pane.html
+ Pane(T),
+}