diff options
| author | pml68 <contact@pml68.me> | 2024-09-02 23:36:51 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.me> | 2024-09-22 23:55:11 +0200 |
| commit | 58d05fc93c118661a09688f530b5c62339eba6e0 (patch) | |
| tree | 02797f7f5e8da762730119f757d0bedf7f605437 /src/types/mod.rs | |
| parent | feat: add usable state logic (diff) | |
| download | iced-builder-58d05fc93c118661a09688f530b5c62339eba6e0.tar.gz | |
feat: start codegen
Diffstat (limited to 'src/types/mod.rs')
| -rw-r--r-- | src/types/mod.rs | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/types/mod.rs b/src/types/mod.rs index 69df615..31c233d 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1,4 +1,10 @@ -use iced::{Font, Length}; +use std::path::PathBuf; + +use iced::{ + alignment::{Horizontal, Vertical}, + widget::{text::Shaping, text_editor}, + Alignment, ContentFit, Font, Length, +}; pub struct DesignerState { pub designer_content: Vec<RenderedElement>, @@ -7,19 +13,35 @@ pub struct DesignerState { pub struct RenderedElement { pub id: String, - pub children: Vec<RenderedElement>, + pub children: Option<Vec<RenderedElement>>, pub name: ElementName, - pub props: Vec<Prop>, + pub props: Props, } -pub enum ElementName {} +pub enum ElementName { + Text(String), + Button(String), + TextEditor(text_editor::Content), + SVG(PathBuf), + Image(PathBuf), + Container, + Row, + Column, +} -pub enum Prop { - String(String, String), - Decimal(String, i32), - Float(String, f32), - Font(String, Font), - Length(String, Length), +pub struct Props { + align_items: Option<Alignment>, + align_x: Option<Horizontal>, + align_y: Option<Vertical>, + horizontal_alignment: Option<Horizontal>, + vertical_alignment: Option<Vertical>, + height: Option<Length>, + width: Option<Length>, + font: Option<Font>, + padding: Option<i32>, + spacing: Option<i32>, + content_fit: Option<ContentFit>, + shaping: Option<Shaping>, } pub enum DesignerPage { |
