mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 10:38:11 +08:00
Implement abstract syntax tree parsing of XML layout
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
<box content="INNER_XML" :fill="FILL = none" :round="ROUND = 0px" :border-thickness="BORDER_THICKNESS = 0px" :border-color="BORDER_COLOR = none">
|
||||
<box content="INNER_XML: (None) = none" :fill="FILL: (Color | None) = none" :round="ROUND: (AbsolutePx) = 0px" :border-thickness="BORDER_THICKNESS: (AbsolutePx) = 0px" :border-color="BORDER_COLOR: (Color | None) = none">
|
||||
{{INNER_XML}}
|
||||
</box>
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<col content="INNER_XML">
|
||||
<col content="INNER_XML: (None) = none">
|
||||
{{INNER_XML}}
|
||||
</col>
|
||||
@@ -1,20 +1,20 @@
|
||||
<header:file-menu>
|
||||
<box height="100%" x-padding="10px">
|
||||
<text height="100%" y-align="0.5" :color="[mildwhite]">፨</text>
|
||||
<text height="100%" y-align="50%" :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="50%" :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="50%" :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="50%" :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="50%" :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="50%" :color="['mildwhite']">Help</text>
|
||||
</box>
|
||||
</header:file-menu>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<header:window-buttons :maximized="IS_MAXIMIZED">
|
||||
<box height="100%" y-align="0.5" x-padding="18px">
|
||||
<header:window-buttons :maximized="IS_MAXIMIZED: (Bool) = false">
|
||||
<box height="100%" y-align="50%" x-padding="18px">
|
||||
<icon :src="window_minimize.svg" />
|
||||
</box>
|
||||
<box height="100%" y-align="0.5" x-padding="18px">
|
||||
<box height="100%" y-align="50%" x-padding="18px">
|
||||
<if :a="{{IS_MAXIMIZED}}">
|
||||
<icon :src="window_restore_down.svg" />
|
||||
</if>
|
||||
@@ -10,7 +10,7 @@
|
||||
<icon :src="maximize.svg" />
|
||||
</if>
|
||||
</box>
|
||||
<box height="100%" y-align="0.5" x-padding="18px">
|
||||
<box height="100%" y-align="50%" x-padding="18px">
|
||||
<icon :src="window_close.svg" />
|
||||
</box>
|
||||
</header:window-buttons>
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<icon content="SVG_DATA" :src="SVG_SOURCE = none">
|
||||
<icon content="SVG_DATA: (None) = none" :src="SVG_SOURCE: (TemplateString | None) = none">
|
||||
|
||||
</icon>
|
||||
@@ -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: (None) = none" :disabled="DISABLED: (Bool) = false" :checked="CHECKED: (Bool) = false" :selected-index="SELECTED_INDEX: (Integer) = 0">
|
||||
<!-- Checkbox -->
|
||||
<col width="height" height="100%">
|
||||
<box width="100%" height="100%" x-align="0.5" y-align="0.5" :fill="[accent]">
|
||||
<box width="100%" height="100%" x-align="50%" y-align="50%" :round="4px 0px 0px 4px" :fill="['accent']">
|
||||
<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%" :selected-index="{{SELECTED_INDEX}}" :disabled="{{DISABLED}}">{{OPTION_LIST}}</input:dropdown>
|
||||
</col>
|
||||
</input:checkbox-with-dropdown>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<input:checkbox :checked="CHECKED = false" :disabled="DISABLED = false" :inverted="INVERTED = false">
|
||||
<input:checkbox :checked="CHECKED: (Bool) = false" :disabled="DISABLED: (Bool) = false" :inverted="INVERTED: (Bool) = false">
|
||||
<box width="14px" height="14px" :fill="{{BOX_COLOR}}" :round="2px">
|
||||
<if :a="{{CHECKED}}">
|
||||
<if :a="{{INVERTED}}" :b="false">
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<input:dropdown content="OPTION_LIST" :default="DEFAULT = 0" :disabled="DISABLED = false">
|
||||
<input:dropdown content="OPTION_LIST: (TemplateString | None) = none" :selected-index="SELECTED_INDEX: (Integer) = 0" :disabled="DISABLED: (Bool) = 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="50%" y-align="50%" :color="['mildwhite']">{{CURRENT_TEXT}}</text>
|
||||
</col>
|
||||
<!-- Dropdown arrow icon -->
|
||||
<col width="8px" height="100%">
|
||||
<icon width="8px" height="100%" x-align="0.5" y-align="0.5">
|
||||
<icon width="8px" height="100%" x-align="50%" y-align="50%">
|
||||
<svg width="7" height="5" viewBox="0 0 7 5">
|
||||
<path d="M0,.5l3.5,3L7,.5v2l-3.5,3L0,2.5Z" transform="translate(0 -0.5)" fill="#ddd" />
|
||||
</svg>
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<row content="INNER_XML">
|
||||
<row content="INNER_XML: (None) = none">
|
||||
{{INNER_XML}}
|
||||
</row>
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<text content="TEXT_STRING" :color="COLOR = [middlegray]" :size="SIZE = 12px">
|
||||
<text content="TEXT_STRING: (None) = none" :color="COLOR: (Color | None) = ['middlegray']" :size="SIZE: (AbsolutePx) = 12px">
|
||||
|
||||
</text>
|
||||
@@ -1,7 +1,7 @@
|
||||
<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 :checked="true" :selected-index="2">
|
||||
Option A
|
||||
Option B
|
||||
Option C
|
||||
</checkbox-with-dropdown>
|
||||
</viewport:panels>
|
||||
+6
-6
@@ -2,17 +2,17 @@
|
||||
<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="50%" x-align="50%" :color="['mildwhite']">Document 1* - Graphite</text>
|
||||
<header:window-buttons height="100%" x-align="100%" />
|
||||
</row>
|
||||
<!-- Viewport -->
|
||||
<row width="100%" height="100@">
|
||||
<viewport:panels />
|
||||
<viewport:panels width="100%" height="100%" />
|
||||
</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="50%" 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="50%" x-align="100%" x-padding="10px" :color="['mildwhite']" :size="14px">🖰 Box Select Objects | [⇧G] Move Selection | [⇧R] Rotate Selection | [⇧S] Scale Selection</text>
|
||||
</row>
|
||||
</window:main>
|
||||
|
||||
Reference in New Issue
Block a user