Open main menu

Difference between revisions of "GUI Themes/STX Syntax"

Updated the properties of <widget> (local widget definition) and <layout> keys.
m (Text replacement - "</source>" to "</syntaxhighlight>")
(Updated the properties of <widget> (local widget definition) and <layout> keys.)
 
Line 679: Line 679:
Parent: <tt>&lt;dialog&gt;</tt>, <tt>&lt;layout&gt;</tt><br />
Parent: <tt>&lt;dialog&gt;</tt>, <tt>&lt;layout&gt;</tt><br />
Children: <tt>&lt;import&gt;</tt>, <tt>&lt;widget&gt;</tt>, <tt>&lt;space&gt;</tt>, <tt>&lt;layout&gt;</tt><br />
Children: <tt>&lt;import&gt;</tt>, <tt>&lt;widget&gt;</tt>, <tt>&lt;space&gt;</tt>, <tt>&lt;layout&gt;</tt><br />
Properties: <tt>type</tt> (''required''), <tt>center</tt>, <tt>direction</tt>, <tt>padding</tt>, <tt>spacing</tt>
Properties: <tt>type</tt> (''required''), <tt>align</tt>, <tt>padding</tt>, <tt>spacing</tt>


===== Example =====
===== Example =====


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<layout type = 'vertical' center = 'true' padding = '23, 23, 8, 23'>
<layout type = 'vertical' align = 'center' padding = '23, 23, 8, 23'>
     ...
     ...
</layout>
</layout>
Line 700: Line 700:


* <tt>type [string]</tt>: Sets whether the layout is <tt>vertical</tt> or <tt>horizontal</tt>.
* <tt>type [string]</tt>: Sets whether the layout is <tt>vertical</tt> or <tt>horizontal</tt>.
* <tt>center [bool]</tt>: Sets whether children widgets inside this layout will be automatically centered.
* <tt>align [string]</tt>: Sets the alignment of the children widgets. Allowed values are <tt>start</tt>, <tt>center</tt>, <tt>end</tt>, and <tt>stretch</tt>. Default is <tt>start</tt>.
* <tt>direction [string]</tt>: Sets the positioning direction of the children widgets:
** <tt>right2left</tt>: Children widgets will be placed starting on the right, as they are parsed.
** <tt>bottom2top</tt>: Children widgets will be placed starting on the bottom, as they are parsed.
* <tt>padding [int, int, int, int]</tt>: Sets the inner padding for the children widgets inside the layout.
* <tt>padding [int, int, int, int]</tt>: Sets the inner padding for the children widgets inside the layout.
* <tt>spacing [int]</tt>: Sets the spacing between two children widgets inside the layout.
* <tt>spacing [int]</tt>: Sets the spacing between two children widgets inside the layout.
Line 785: Line 782:
Parent: <tt>&lt;layout&gt;</tt><br />
Parent: <tt>&lt;layout&gt;</tt><br />
Children: -<br />
Children: -<br />
Properties: <tt>name</tt> (''required''), <tt>width</tt>, <tt>height</tt>, <tt>type</tt>, <tt>enabled</tt>, <tt>textalign</tt>
Properties: <tt>name</tt> (''required''), <tt>width</tt>, <tt>height</tt>, <tt>type</tt>, <tt>textalign</tt>, <tt>rtl</tt>


===== Example =====
===== Example =====
Line 815: Line 812:
* <tt>height [int]</tt>: Height of the widget.
* <tt>height [int]</tt>: Height of the widget.
* <tt>type [string]</tt>: Global Widget Definition from which this widget will inherit its properties.
* <tt>type [string]</tt>: Global Widget Definition from which this widget will inherit its properties.
* <tt>enabled [bool]</tt>: Sets whether this widget is enabled. Defaults always to true. May be used to disable widgets on certain resolutions.
* <tt>textalign [string]</tt>: Sets horizontal alignment of text on this widget. Allowed values are <tt>start</tt>, <tt>end</tt>, <tt>left</tt>, <tt>right</tt> and <tt>center</tt>. <tt>start</tt> and <tt>end</tt> adapt alignment to GUI's RTL or LTR orientation. Default value is <tt>start</tt>.
* <tt>textalign [string]</tt>: Sets horizontal alignment of text on this widget. Allowed values are <tt>left</tt>, <tt>right</tt> and <tt>center</tt>. Default value is <tt>left</tt>.
*<tt>rtl [bool]</tt>: Sets whether this widget respects RTL orientation when GUI is set to use an RTL language. Defaults always to true. May be used to keep widgets in LTR orientation on both RTL and LTR languages.
1

edit