Ubuntu.Components Theme

The Theme class provides facilities to interact with the current theme.

Import Statement: import Ubuntu.Components 1.3

Properties

Methods

  • Component createStyleComponent(string styleName, object parent)

Detailed Description

A global instance is exposed as the Theme context property.

The theme defines the visual aspect of the Ubuntu components.

Example changing the current theme:

import QtQuick 2.4
import Ubuntu.Components 1.2
Item {
    Button {
        onClicked: Theme.name = "Ubuntu.Components.Themes.Ambiance"
    }
}

Example creating a style component:

import QtQuick 2.4
import Ubuntu.Components 1.2
StyledItem {
    id: myItem
    style: Theme.createStyleComponent("MyItemStyle.qml", myItem)
}

See also StyledItem.

Property Documentation

name : string

The name of the current theme.

palette : Palette

The palette of the current theme.

Method Documentation

Component createStyleComponent(string styleName, object parent)

Returns an instance of the style component named styleName.