From e8792ea151e0c26fd3497a09446f1b846df1c87c Mon Sep 17 00:00:00 2001 From: pml68 Date: Tue, 3 Sep 2024 21:55:34 +0200 Subject: feat: finish codegen for elements **without** props feat: wow --- src/types/mod.rs | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'src/types/mod.rs') diff --git a/src/types/mod.rs b/src/types/mod.rs index 09b0f07..60b28f7 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1,24 +1,17 @@ -use std::path::PathBuf; +pub mod props; +pub mod rendered_element; -use iced::{ - alignment::{Horizontal, Vertical}, - widget::{text::Shaping, text_editor}, - Alignment, ContentFit, Font, Length, -}; +use iced::widget::text_editor; +use rendered_element::RenderedElement; +use std::path::PathBuf; pub struct DesignerState { pub designer_content: Vec, pub designer_page: DesignerPage, } -pub struct RenderedElement { - pub id: String, - pub children: Option>, - pub name: ElementName, - pub props: Props, -} - pub enum ElementName { + App(String, iced::Theme), Text(String), Button(String), TextEditor(text_editor::Content), @@ -29,21 +22,6 @@ pub enum ElementName { Column, } -pub struct Props { - pub align_items: Option, - pub align_x: Option, - pub align_y: Option, - pub horizontal_alignment: Option, - pub vertical_alignment: Option, - pub height: Option, - pub width: Option, - pub font: Option, - pub padding: Option, - pub spacing: Option, - pub content_fit: Option, - pub shaping: Option, -} - pub enum DesignerPage { Designer, CodeView, -- cgit v1.2.3