Absolute.Style¶
The Absolute.Style
package contains all the classes used to customize the QQC2 Style.
Import statement:
import Absolute.Style 0.1
MaterialIcons¶
MaterialIcons is a singleton object that has properties for all the icons that can be used from the font.
Properties¶
icon_xxx
: readonly properties for all the icons that can be found in the Material Icons fontfamily
: the name of the Material Icons font family
Palette¶
Contains all the color properties used to render controls.
Properties¶
base
: Color used as the background color for root containers such as Window/ApplicationWindow, Drawer, Popup and Dialog.contrast
: Color used as the background color of internal containers such as Pane and Frame with a very low opacity and as the foreground and border color of most controls with a very high opacity.power
: Factor used to customize the amount of opacity of the contrast color. Default is 1.0.primary
: Color used for the background of ToolBar and MenuBar. Default isbase
.primaryContrast
: Color used by ToolButton and MenuItem text rendering. Default iscontrast
.separator
: Color used for separators (dialog/popup/menu borders).accent
: Color used to hihglight specific part of the control when it is checked,enabled,highlighted,…info
: The color to use to highlight some important information to the user.success
: The color to use to highlight a successful action to the user.warning
: The color to use to show a warning the user.danger
: The color to use to highlight a dangerous action to the user.
Style¶
Singleton object that can be used to access the Absolute style properties (theme, typography,…)
Properties¶
theme
: The color theme used by the style. Default value is to the Default theme.typography
: Typography options (font size,…)iconFont
: Icon font family used to render icons. Default is Material Icons
StyleConfiguration¶
Convenience item to configure Absolute Style declaratively.
Properties¶
The below properties are propageted to the Style
singleton.
theme
: The color theme used by the style. Default value is to the Default theme.typography
: Typography options (font size,…)iconFont
: Icon font family used to render icons. Default is Material Icons
Theme¶
A theme is composed by a dark and a light palette as well as some other properties such as default radius and default elevation.
Properties¶
dark
: the darkPalette
of the Theme.light
: the lightPalette
of the Theme.radius
: Radius value used in various controls. Set it to 0 to disable radius globally.
Methods¶
palette(bool isDark)
: utility function to either get thedark
orlight
palette of the theme. Typical usage:Material.accent: Style.theme.palette(Material.theme === Material.Dark).info
Typography¶
Properties¶
smaller
: Smaller font size. Default is 9small
: Small font size. Default is 11medium
: Medium font size. Default is 13. This is the size used in most controls.big
: Big font size. Default is 16bigger
: Bigger font size. Default is 18
Absolute.Style.Themes¶
The Absolute.Style.Themes
package contains the implementation of our builtin themes as well as a convenience item
to list all available themes and register custom ones.
Import statement:
import Absolute.Style 0.1
AvailableThemes¶
Convenience object to expose the list of available themes.
Builtin themes:
- “Default”
- “Native
Properties¶
model
: A ListModel that contains all the builtin themes as well as those manually register. Can be used to feed a Menu/ComboBox.
Methods¶
byName(str: name) -> Theme
: Returns a Theme instance by name. Will return undefined if the theme does not exist.register(str: name, Theme: theme)
: Registers a custom theme and make it available to themodel
andbyName
.
Default¶
The default Absolute theme.
Native¶
A native theme that tries to use the native colors using the SystemPalette
Warning
The native theme may not work correctly under GNome if the current gtk 3 theme does not include a gtk2 theme version.