2023-03-04 05:37:11 +01:00
|
|
|
use crate::pane_grid::Axis;
|
2020-06-04 07:13:38 +02:00
|
|
|
|
|
|
|
|
/// The arrangement of a [`PaneGrid`].
|
|
|
|
|
///
|
2023-09-09 12:24:47 +02:00
|
|
|
/// [`PaneGrid`]: super::PaneGrid
|
2020-06-04 07:13:38 +02:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
pub enum Configuration<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,
|
|
|
|
|
|
2020-11-25 05:26:03 +01:00
|
|
|
/// The left/top [`Configuration`] of the split.
|
2020-06-04 07:13:38 +02:00
|
|
|
a: Box<Configuration<T>>,
|
|
|
|
|
|
2020-11-25 05:26:03 +01:00
|
|
|
/// The right/bottom [`Configuration`] of the split.
|
2020-06-04 07:13:38 +02:00
|
|
|
b: Box<Configuration<T>>,
|
|
|
|
|
},
|
|
|
|
|
/// A [`Pane`].
|
|
|
|
|
///
|
2023-09-09 12:24:47 +02:00
|
|
|
/// [`Pane`]: super::Pane
|
2020-06-04 07:13:38 +02:00
|
|
|
Pane(T),
|
|
|
|
|
}
|