summaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-10-17 19:21:47 +0200
committerLaurenz <laurmaedje@gmail.com>2019-10-17 19:21:47 +0200
commit991e879e1d2ed53125dbff4edba80804ff28f2a9 (patch)
tree0917f83108feca10ca4207dd9089fe57cf8098d5 /src/layout/mod.rs
parent1987e5861cf2c033e3a540a5ef7c0f7106016929 (diff)
Extend stack layouts from vertical to horizontal flows ➡
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index fccbe8c8..470ac3ba 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -134,6 +134,8 @@ pub struct LayoutContext<'a, 'p> {
pub style: &'a TextStyle,
/// The alignment to use for the content.
pub alignment: Alignment,
+ /// How to stack the context.
+ pub flow: Flow,
/// The primary space to layout in.
pub space: LayoutSpace,
/// The additional spaces which are used when the primary space
@@ -176,6 +178,13 @@ pub enum Alignment {
Center,
}
+/// The flow of content.
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+pub enum Flow {
+ Vertical,
+ Horizontal,
+}
+
/// The error type for layouting.
pub enum LayoutError {
/// There is not enough space to add an item.