Some more layout features, align/stretch.
This commit is contained in:
@@ -68,9 +68,9 @@ pub mod prelude {
|
||||
view,
|
||||
};
|
||||
pub use ruin_ui::{
|
||||
Border, Color, CursorIcon, Edges, Element, ElementId, InteractionTree, PointerButton,
|
||||
PointerEventKind, RoutedPointerEvent, RoutedPointerEventKind, ScrollbarStyle,
|
||||
TextFontFamily, TextStyle, TextWrap, UiSize,
|
||||
AlignItems, Border, Color, CursorIcon, Edges, Element, ElementId, InteractionTree,
|
||||
PointerButton, PointerEventKind, RoutedPointerEvent, RoutedPointerEventKind,
|
||||
ScrollbarStyle, TextFontFamily, TextStyle, TextWrap, UiSize,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use ruin_ui::{Color, Element, ElementId};
|
||||
use ruin_ui::{AlignItems, Color, Element, ElementId};
|
||||
|
||||
use crate::context::allocate_element_id;
|
||||
use crate::converters::{IntoBorder, IntoEdges, IntoShadow};
|
||||
@@ -82,6 +82,16 @@ impl ContainerProps {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn align_items(mut self, align: AlignItems) -> Self {
|
||||
self.element = self.element.align_items(align);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn align_self(mut self, align: AlignItems) -> Self {
|
||||
self.element = self.element.align_self(align);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn shadow(mut self, shadow: impl IntoShadow) -> Self {
|
||||
self.element = self.element.shadow(shadow.into_shadow());
|
||||
self
|
||||
@@ -118,6 +128,16 @@ pub fn block() -> ContainerBuilder {
|
||||
impl ContainerBuilder {
|
||||
impl_props_methods!();
|
||||
|
||||
pub fn align_items(mut self, align: AlignItems) -> Self {
|
||||
self.props = self.props.align_items(align);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn align_self(mut self, align: AlignItems) -> Self {
|
||||
self.props = self.props.align_self(align);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn shadow(mut self, shadow: impl IntoShadow) -> Self {
|
||||
self.props = self.props.shadow(shadow);
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user