~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

Viewing all changes in revision 572.

  • Committer: Tarmac
  • Author(s): Kaleo
  • Date: 2013-07-02 14:38:38 UTC
  • mfrom: (552.3.44 simple_theming)
  • Revision ID: tarmac-20130702143838-a3l620hpcrajazqa
Simplified theming infrastructure.

There are no stylesheets anymore (.qmltheme file), only delegates remain. A theme is a QML module containing delegates whose names are standardized.
The default theme is called 'Ambiance' and available from QML through 'import Ubuntu.Components.Themes.Ambiance 0.1'.
The name of the current theme is set in ~/.config/ubuntu-ui-toolkit/theme.ini

Writing a new theme is done by creating a QML module and adding it in the Ubuntu/Components/Themes folder.
A theme inherits from another theme by containing a text file name 'parent_theme' whose first and only line is the name of the parent theme.

* Moved themes/ directory to Ubuntu/Components/Themes so that themes are importable.
* Simplified ThemeEngine and ThemeSettings class, removed the rest of the theming infrastructure (ItemStyle, Style, QmlThemeLoader, Selector, StyleCache).
* Adapted all widgets to use the simplified theming technique:
 - new StyledItem class that has a 'style' Component property representing the delegate
 - all widgets that have delegates inherit from StyledItem
 - all widgets set the 'style' property to the corresponding delegate in the current theme by using Theme.createStyleComponent()
 - Ambiance's stylesheet property/values have been moved to where they are used (mostly to the delegates)
 - TextAreaDelegate: exposed background as Component property
 - Added a delegate specific to TextField: TextFieldDelegate
 - Renamed delegates so that they match their widget's name (e.g. EditorCursorDelegate.qml renamed to TextCursorDelegate.qml since it's the delegate of TextCursor.qml)
* Renamed UITK_THEME_PATH into UBUNTU_UI_TOOLKIT_THEMES_PATH. Fixes: https://bugs.launchpad.net/bugs/1081038, https://bugs.launchpad.net/bugs/1137210, https://bugs.launchpad.net/bugs/1152154, https://bugs.launchpad.net/bugs/1152158, https://bugs.launchpad.net/bugs/1152160, https://bugs.launchpad.net/bugs/1152161, https://bugs.launchpad.net/bugs/1152162, https://bugs.launchpad.net/bugs/1167998, https://bugs.launchpad.net/bugs/1185950.

Approved by PS Jenkins bot.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: