Builtin Globals
Palette
Use Palette
to create custom widgets that match the colors of
the selected style e.g. fluent, cupertino, material, or qt.
Properties
background
(out brush): Defines the default background brush. Use this if none of the more specialized background brushes apply.foreground
(out brush): Defines the foreground brush that is used for content that is displayed onbackground
brush.alternate-background
(out brush): Defines an alternate background brush that is used for example for text input controls or panels like a side bar.alternate-foreground
(out brush): Defines the foreground brush that is used for content that is displayed onalternate-background
brush.control-background
(out brush): Defines the default background brush for controls, such as push buttons, combo boxes, etc.control-foreground
(out brush): Defines the foreground brush that is used for content that is displayed oncontrol-background
brush.accent-background
(out brush): Defines the background brush for highlighted controls such as primary buttons.accent-foreground
(out brush): Defines the foreground brush that is used for content that is displayed onaccent-background
brush.selection-background
(out brush): Defines the background brush that is used to highlight a selection such as a text selection.selection-foreground
(out brush): Defines the foreground brush that is used for content that is displayed onselection-background
brush.border
(out brush): Defines the brush that is used for borders such as separators and widget borders.color-scheme
(in out enumColorScheme
): Read this property to determine the color scheme used by the palette. Set this property to force a dark or light color scheme. All styles except for the Qt style support setting a dark or light color scheme.
Example
LayoutSpec
Use LayoutSpec
to create custom widgets that match the layout settings of
the selected style e.g. fluent, cupertino, material, or qt.
Properties
layout-spacing
(out length): Defines the default layout spacing. This spacing is also used byVerticalBox
,HorizontalBox
andGridBox
.layout-padding
(out length): Defines the default layout padding. This padding is also used byVerticalBox
,HorizontalBox
andGridBox
.
TextInputInterface
The TextInputInterface.text-input-focused
property can be used to find out if a TextInput
element has the focus.
If you’re implementing your own virtual keyboard, this property is an indicator whether the virtual keyboard should be shown or hidden.
Properties
text-input-focused
(bool): True if anTextInput
element has the focus; false otherwise.