new rendering engine
This commit is contained in:
@@ -113,6 +113,8 @@ impl LayoutNodeDto {
|
||||
direction,
|
||||
gap: self.gap.unwrap_or(0),
|
||||
padding: self.padding.unwrap_or(0),
|
||||
justify_content: JustifyContent::Start,
|
||||
align_items: AlignItems::Stretch,
|
||||
children,
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ impl From<&WidgetConfig> for WidgetDto {
|
||||
Self {
|
||||
id: w.id,
|
||||
name: w.name.clone(),
|
||||
display_hint: match w.display_hint {
|
||||
DisplayHint::IconValue => "icon_value",
|
||||
DisplayHint::TextBlock => "text_block",
|
||||
DisplayHint::KeyValue => "key_value",
|
||||
display_hint: match w.display_hint.kind {
|
||||
DisplayHintKind::IconValue => "icon_value",
|
||||
DisplayHintKind::TextBlock => "text_block",
|
||||
DisplayHintKind::KeyValue => "key_value",
|
||||
}
|
||||
.into(),
|
||||
data_source_id: w.data_source_id,
|
||||
@@ -60,9 +60,9 @@ impl From<&WidgetConfig> for WidgetDto {
|
||||
impl CreateWidgetDto {
|
||||
pub fn into_domain(self) -> Result<WidgetConfig, String> {
|
||||
let hint = match self.display_hint.as_str() {
|
||||
"icon_value" => DisplayHint::IconValue,
|
||||
"text_block" => DisplayHint::TextBlock,
|
||||
"key_value" => DisplayHint::KeyValue,
|
||||
"icon_value" => DisplayHint::new(DisplayHintKind::IconValue),
|
||||
"text_block" => DisplayHint::new(DisplayHintKind::TextBlock),
|
||||
"key_value" => DisplayHint::new(DisplayHintKind::KeyValue),
|
||||
h => return Err(format!("unknown display_hint: {h}")),
|
||||
};
|
||||
Ok(WidgetConfig {
|
||||
|
||||
Reference in New Issue
Block a user