2020-05-12 10:09:30 +02:00
|
|
|
use crate::pane_grid::Axis;
|
|
|
|
|
|
2020-05-22 22:15:44 +02:00
|
|
|
/// The content of a [`PaneGrid`].
|
|
|
|
|
///
|
|
|
|
|
/// [`PaneGrid`]: struct.PaneGrid.html
|
2020-05-12 10:09:30 +02:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
pub enum Content<T> {
|
2020-05-22 22:15:44 +02:00
|
|
|
/// A split of the available space.
|
2020-05-12 10:09:30 +02:00
|
|
|
Split {
|
2020-05-22 22:15:44 +02:00
|
|
|
/// The direction of the split.
|
2020-05-12 10:09:30 +02:00
|
|
|
axis: Axis,
|
2020-05-22 22:15:44 +02:00
|
|
|
|
|
|
|
|
/// The ratio of the split in [0.0, 1.0].
|
2020-05-12 10:09:30 +02:00
|
|
|
ratio: f32,
|
2020-05-22 22:15:44 +02:00
|
|
|
|
|
|
|
|
/// The left/top [`Content`] of the split.
|
|
|
|
|
///
|
|
|
|
|
/// [`Content`]: enum.Node.html
|
2020-05-12 10:09:30 +02:00
|
|
|
a: Box<Content<T>>,
|
2020-05-22 22:15:44 +02:00
|
|
|
|
|
|
|
|
/// The right/bottom [`Content`] of the split.
|
|
|
|
|
///
|
|
|
|
|
/// [`Content`]: enum.Node.html
|
2020-05-12 10:09:30 +02:00
|
|
|
b: Box<Content<T>>,
|
|
|
|
|
},
|
2020-05-22 22:15:44 +02:00
|
|
|
/// A [`Pane`].
|
|
|
|
|
///
|
|
|
|
|
/// [`Pane`]: struct.Pane.html
|
2020-05-12 10:09:30 +02:00
|
|
|
Pane(T),
|
|
|
|
|
}
|