Introduce and use CrossAlign enum for Column and Row
This commit is contained in:
parent
95e4791a1e
commit
5fae6e59ff
33 changed files with 166 additions and 115 deletions
|
|
@ -9,11 +9,34 @@ pub enum Align {
|
|||
|
||||
/// Align at the end of the axis.
|
||||
End,
|
||||
}
|
||||
|
||||
/// Alignment on the cross axis of a container.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum CrossAlign {
|
||||
/// Align at the start of the axis.
|
||||
Start,
|
||||
|
||||
/// Align at the center of the axis.
|
||||
Center,
|
||||
|
||||
/// Align at the end of the axis.
|
||||
End,
|
||||
|
||||
/// Fill the entire axis.
|
||||
Fill,
|
||||
}
|
||||
|
||||
impl From<Align> for CrossAlign {
|
||||
fn from(align: Align) -> Self {
|
||||
match align {
|
||||
Align::Start => Self::Start,
|
||||
Align::Center => Self::Center,
|
||||
Align::End => Self::End,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The horizontal alignment of some resource.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum HorizontalAlignment {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ mod rectangle;
|
|||
mod size;
|
||||
mod vector;
|
||||
|
||||
pub use align::{Align, HorizontalAlignment, VerticalAlignment};
|
||||
pub use align::{Align, CrossAlign, HorizontalAlignment, VerticalAlignment};
|
||||
pub use background::Background;
|
||||
pub use color::Color;
|
||||
pub use font::Font;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue