Update docs/labwc-config.5.scd

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
This commit is contained in:
Johan Malm 2024-03-24 21:12:44 +00:00 committed by GitHub
parent 6ef1db54d8
commit aa67a0bcd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,10 +98,24 @@ Configuration must be wrapped in a <labwc_config> root-element like this:
*labwc* parses XML in an element/attribute agnostic way. This is a design
decision to increase config file flexibility and keep code simple. In practical
terms, this means that `<a><b>c</b></a>` is equivalent to `<a b="c" />`.
terms, this means that `<a><b>c</b></a>` is usually equivalent to `<a b="c" />`.
However, there are some caveats:
- In menu.xml, the attributes `id` and `label` *must* be expressed as attributes
rather than as separate child tags.
- Ordering of attributes can sometimes be singificant. For example, when setting
fonts via attributes rather than children,
<font place="ActiveWindow" name="..." size="..." />
Note: This does not apply to all aspects of menu.xml, specifically the
attributes id, label and execute.
will set a font for active window titles, while
<font name="..." size="..." place="ActiveWindow" />
will set a font as if `place` were unspecified, because `name` and `size` will be
processed before `place`.
In general, it is recommended that attributes not be used to collapse more than
one level of the configuration hierarchy.
The following three are therefore treated the same: