diff options
Diffstat (limited to 'src/tuine/container.rs')
-rw-r--r-- | src/tuine/container.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tuine/container.rs b/src/tuine/container.rs new file mode 100644 index 00000000..e26006dc --- /dev/null +++ b/src/tuine/container.rs @@ -0,0 +1,27 @@ +use crate::canvas::LayoutConstraint; + +use super::Element; + +/// A [`ContainerDirection`] determines the direction of the [`Container`]. +pub enum ContainerDirection { + Row, + Column, +} + +/// A [`Container`] holds either more containers or a [`BottomWidget`]. +/// +/// Basically, a non-leaf node in the [`Element`] tree. +pub struct Container { + direction: ContainerDirection, + constraint: LayoutConstraint, + pub(super) children: Vec<Element>, +} + +impl Container { + pub fn draw(&mut self) { + match self.direction { + ContainerDirection::Row => {} + ContainerDirection::Column => {} + } + } +} |