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 font
  • family: 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 is base.
  • primaryContrast: Color used by ToolButton and MenuItem text rendering. Default is contrast.
  • 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 dark Palette of the Theme.
  • light: the light Palette 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 the dark or light palette of the theme. Typical usage:

    Material.accent: Style.theme.palette(Material.theme === Material.Dark).info
    

Typography

Properties

  • smaller: Smaller font size. Default is 9
  • small: Small font size. Default is 11
  • medium: Medium font size. Default is 13. This is the size used in most controls.
  • big: Big font size. Default is 16
  • bigger: 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 the model and byName.

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.