Skip to content
Snippets Groups Projects
Commit aeced1fc authored by MrGVSV's avatar MrGVSV
Browse files

Added row_gap and col_gap

parent 6d552cb2
No related branches found
No related tags found
No related merge requests found
......@@ -307,11 +307,29 @@ impl<'a> morphorm::Node<'a> for Index {
return Some(morphorm::Units::Auto);
}
fn row_between(&self, _store: &'_ Self::Data) -> Option<morphorm::Units> {
fn row_between(&self, store: &'_ Self::Data) -> Option<morphorm::Units> {
if let Some(node) = store.get(*self) {
if let Some(node) = node {
return match node.resolved_styles.row_gap {
StyleProp::Default => Some(morphorm::Units::Auto),
StyleProp::Value(prop) => Some(prop),
_ => Some(morphorm::Units::Auto),
};
}
}
Some(morphorm::Units::Auto)
}
fn col_between(&self, _store: &'_ Self::Data) -> Option<morphorm::Units> {
fn col_between(&self, store: &'_ Self::Data) -> Option<morphorm::Units> {
if let Some(node) = store.get(*self) {
if let Some(node) = node {
return match node.resolved_styles.col_gap {
StyleProp::Default => Some(morphorm::Units::Auto),
StyleProp::Value(prop) => Some(prop),
_ => Some(morphorm::Units::Auto),
};
}
}
Some(morphorm::Units::Auto)
}
......
......@@ -142,6 +142,8 @@ define_styles! {
pub border: StyleProp<(f32, f32, f32, f32)>,
pub bottom: StyleProp<Units>,
pub color: StyleProp<Color>,
/// The spacing between child widgets along the horizontal axis
pub col_gap: StyleProp<Units>,
pub cursor: StyleProp<CursorIcon>,
pub height: StyleProp<Units>,
pub layout_type: StyleProp<LayoutType>,
......@@ -158,6 +160,8 @@ define_styles! {
pub position_type: StyleProp<PositionType>,
pub render_command: StyleProp<RenderCommand>,
pub right: StyleProp<Units>,
/// The spacing between child widgets along the vertical axis
pub row_gap: StyleProp<Units>,
pub top: StyleProp<Units>,
pub width: StyleProp<Units>,
}
......@@ -177,6 +181,7 @@ impl Style {
bottom: StyleProp::Default,
color: StyleProp::Inherit,
cursor: StyleProp::Inherit,
col_gap: StyleProp::Default,
height: StyleProp::Default,
layout_type: StyleProp::Default,
left: StyleProp::Default,
......@@ -192,6 +197,7 @@ impl Style {
position_type: StyleProp::Default,
render_command: StyleProp::Value(RenderCommand::Empty),
right: StyleProp::Default,
row_gap: StyleProp::Default,
top: StyleProp::Default,
width: StyleProp::Default,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment