Add parsing of XML layout files into a ParsedLayoutNode tree

This commit is contained in:
Keavon Chambers
2020-05-25 22:08:27 -07:00
parent 474b2b39f9
commit f8025b15ea
13 changed files with 221 additions and 55 deletions
+8 -8
View File
@@ -1,20 +1,20 @@
<header.file-menu>
<header:file-menu>
<box height="100%" x-padding="10px">
<text height="100%" y-align="0.5" :color="mildwhite"></text>
<text height="100%" y-align="0.5" :color="[mildwhite]"></text>
</box>
<box height="100%" x-padding="10px">
<text height="100%" y-align="0.5" :color="mildwhite">File</text>
<text height="100%" y-align="0.5" :color="[mildwhite]">File</text>
</box>
<box height="100%" x-padding="10px">
<text height="100%" y-align="0.5" :color="mildwhite">Edit</text>
<text height="100%" y-align="0.5" :color="[mildwhite]">Edit</text>
</box>
<box height="100%" x-padding="10px">
<text height="100%" y-align="0.5" :color="mildwhite">Comp</text>
<text height="100%" y-align="0.5" :color="[mildwhite]">Comp</text>
</box>
<box height="100%" x-padding="10px">
<text height="100%" y-align="0.5" :color="mildwhite">View</text>
<text height="100%" y-align="0.5" :color="[mildwhite]">View</text>
</box>
<box height="100%" x-padding="10px">
<text height="100%" y-align="0.5" :color="mildwhite">Help</text>
<text height="100%" y-align="0.5" :color="[mildwhite]">Help</text>
</box>
</header.file-menu>
</header:file-menu>
+2 -2
View File
@@ -1,4 +1,4 @@
<header.window-buttons :maximized="IS_MAXIMIZED">
<header:window-buttons :maximized="IS_MAXIMIZED">
<box height="100%" y-align="0.5" x-padding="18px">
<icon :src="window_minimize.svg" />
</box>
@@ -13,4 +13,4 @@
<box height="100%" y-align="0.5" x-padding="18px">
<icon :src="window_close.svg" />
</box>
</header.window-buttons>
</header:window-buttons>
+4 -4
View File
@@ -1,12 +1,12 @@
<input.checkbox-with-dropdown content="OPTION_LIST" :disabled="DISABLED = false" :checked="CHECKED = false" :default="DEFAULT = 0">
<input:checkbox-with-dropdown content="OPTION_LIST" :disabled="DISABLED = false" :checked="CHECKED = false" :default="DEFAULT = 0">
<!-- Checkbox -->
<col width="height" height="100%">
<box width="100%" height="100%" x-align="0.5" y-align="0.5" :fill="[accent]">
<input.checkbox :checked="{{CHECKED}}" :disabled="{{DISABLED}}" :inverted="true" />
<input:checkbox :checked="{{CHECKED}}" :disabled="{{DISABLED}}" :inverted="true" />
</box>
</col>
<!-- Dropdown -->
<col width="100%">
<input.dropdown width="100%" :default="{{DEFAULT}}" :disabled="{{DISABLED}}">{{OPTION_LIST}}</input.dropdown>
<input:dropdown width="100%" :default="{{DEFAULT}}" :disabled="{{DISABLED}}">{{OPTION_LIST}}</input:dropdown>
</col>
</input.checkbox-with-dropdown>
</input:checkbox-with-dropdown>
+2 -2
View File
@@ -1,4 +1,4 @@
<input.checkbox :checked="CHECKED = false" :disabled="DISABLED = false" :inverted="INVERTED = false">
<input:checkbox :checked="CHECKED = false" :disabled="DISABLED = false" :inverted="INVERTED = false">
<box width="14px" height="14px" :fill="{{BOX_COLOR}}" :round="2px">
<if :a="{{CHECKED}}">
<if :a="{{INVERTED}}" :b="false">
@@ -17,4 +17,4 @@
</if>
</if>
</box>
</input.checkbox>
</input:checkbox>
+3 -3
View File
@@ -1,8 +1,8 @@
<input.dropdown content="OPTION_LIST" :default="DEFAULT = 0" :disabled="DISABLED = false">
<input:dropdown content="OPTION_LIST" :default="DEFAULT = 0" :disabled="DISABLED = false">
<box width="100%" :round="4px">
<!-- Current selection text -->
<col width="100%" height="24px">
<text width="100%" height="100%" x-align="0.5" y-align="0.5" :color="mildwhite">{{CURRENT_TEXT}}</text>
<text width="100%" height="100%" x-align="0.5" y-align="0.5" :color="[mildwhite]">{{CURRENT_TEXT}}</text>
</col>
<!-- Dropdown arrow icon -->
<col width="8px" height="100%">
@@ -13,4 +13,4 @@
</icon>
</col>
</box>
</input.dropdown>
</input:dropdown>
+2 -2
View File
@@ -1,7 +1,7 @@
<viewport.panels>
<viewport:panels>
<checkbox-with-dropdown :checked="true" :default="2">
<dropdown-option>Option A</dropdown-option>
<dropdown-option>Option B</dropdown-option>
<dropdown-option>Option C</dropdown-option>
</checkbox-with-dropdown>
</viewport.panels>
</viewport:panels>
+9 -9
View File
@@ -1,18 +1,18 @@
<!-- Called as <window.main width="1920px" height="1080px" /> -->
<window.main>
<!-- Called as <window:main width="1920px" height="1080px" /> -->
<window:main>
<!-- Header -->
<row width="100%" height="28px">
<header.file-menu height="100%" x-align="0" />
<text height="100%" y-align="0.5" x-align="0.5" :color="mildwhite">Document 1* - Graphite</text>
<header.window-buttons height="100%" x-align="1" />
<header:file-menu height="100%" x-align="0" />
<text height="100%" y-align="0.5" x-align="0.5" :color="[mildwhite]">Document 1* - Graphite</text>
<header:window-buttons height="100%" x-align="1" />
</row>
<!-- Viewport -->
<row width="100%" height="100@">
<viewport.panels />
<viewport:panels />
</row>
<!-- Footer -->
<row width="100%" height="24px">
<text height="100%" y-align="0.5" x-align="0" x-padding="10px" :color="mildwhite" :size="14px">File: 1.8 MB | Memory: 137 MB | Scratch: 0.7/12.3 GB</text>
<text height="100%" y-align="0.5" x-align="1" x-padding="10px" :color="mildwhite" :size="14px">🖰 Box Select Objects | [⇧G] Move Selection | [⇧R] Rotate Selection | [⇧S] Scale Selection</text>
<text height="100%" y-align="0.5" x-align="0" x-padding="10px" :color="[mildwhite]" :size="14px">File: 1.8 MB | Memory: 137 MB | Scratch: 0.7/12.3 GB</text>
<text height="100%" y-align="0.5" x-align="1" x-padding="10px" :color="[mildwhite]" :size="14px">🖰 Box Select Objects | [⇧G] Move Selection | [⇧R] Rotate Selection | [⇧S] Scale Selection</text>
</row>
</window.main>
</window:main>