-
Notifications
You must be signed in to change notification settings - Fork 4
Styling
Layout xml files do not contain any style information but each element can have a style attribute linking to a style defined in a stylesheet. Those stylesheets are loaded per layout and defined in ".seyegui" files which can look like the example below.
default
{
background-color = 0x101010FF
highlight-color=0x0000FFFF
}
button:default
{
color = 0x707070A0
background-color = 0x00000000
icon-color = 0xFF0000FF
}
Colors must be given in RGBA hexa code with a "0x" as prefix. Each style has to have a name and can inherit properties from another style by postfixing it with ":" and the name of the parent style. The parent must be defined before the usage as parent. If a style property is not defined at all, some fallback is used.
Following properties are possible to define:
| Property | Type |
|---|---|
| background-color | Hex RGBA |
| highlight-color | Hex RGBA |
| separator-color | Hex RGBA |
| selection-color | Hex RGBA |
| icon-color | Hex RGBA |
The defined stylesheet can be loaded for a layout by giving the relative path the attribute "stylesheet" of layout xml element as shown in the following and described in Layouts:
<layout stylesheet="FancyStyling.seyegui">
<circlebutton style="button"></circlebutton>
</layout>A element uses the style of its parent element. If now style is chosen, the style called "default" is used. This style is always created and uses fallback values, if not overriden in the stylesheet.