Introduce and use CrossAlign enum for Column and Row

This commit is contained in:
Héctor Ramón Jiménez 2021-09-20 14:33:02 +07:00
parent 95e4791a1e
commit 5fae6e59ff
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
33 changed files with 166 additions and 115 deletions

View file

@ -1,5 +1,5 @@
//! Style your widgets.
use crate::{bumpalo, Align, Background, Color, Length, Padding};
use crate::{bumpalo, Align, Background, Color, CrossAlign, Length, Padding};
use std::collections::BTreeMap;
@ -201,7 +201,16 @@ pub fn align(align: Align) -> &'static str {
Align::Start => "flex-start",
Align::Center => "center",
Align::End => "flex-end",
Align::Fill => "stretch",
}
}
/// Returns the style value for the given [`CrossAlign`].
pub fn cross_align(align: CrossAlign) -> &'static str {
match align {
CrossAlign::Start => "flex-start",
CrossAlign::Center => "center",
CrossAlign::End => "flex-end",
CrossAlign::Fill => "stretch",
}
}

View file

@ -74,8 +74,9 @@ pub use dodrio;
pub use element::Element;
pub use hasher::Hasher;
pub use iced_core::{
keyboard, mouse, Align, Background, Color, Font, HorizontalAlignment,
Length, Padding, Point, Rectangle, Size, Vector, VerticalAlignment,
keyboard, mouse, Align, Background, Color, CrossAlign, Font,
HorizontalAlignment, Length, Padding, Point, Rectangle, Size, Vector,
VerticalAlignment,
};
pub use iced_futures::{executor, futures};
pub use subscription::Subscription;