| 1 |
/* |
| 2 |
* Copyright 2013 Canonical Ltd. |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU Lesser General Public License as published by |
| 6 |
* the Free Software Foundation; version 3. |
| 7 |
* |
| 8 |
* This program is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
* GNU Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public License |
| 14 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
import QtQuick 2.4 |
| 18 |
|
| 19 |
/*! |
| 20 |
\qmltype Palette |
| 21 |
\inqmlmodule Lomiri.Components.Themes 0.1 |
| 22 |
\ingroup theming |
| 23 |
\brief Palette of colors from the theme that widgets use to draw themselves. |
| 24 |
|
| 25 |
Palette provides access to colors defined by the current theme. The actual |
| 26 |
color palette to use depends on the state of the widget being drawn. |
| 27 |
|
| 28 |
A color palette (\l PaletteValues) has various roles to choose from depending |
| 29 |
on what part of the widget is being drawn (the base of the widget, the |
| 30 |
foreground, etc.). |
| 31 |
|
| 32 |
For each color there is a corresponding 'text' color that is guaranteed to |
| 33 |
provide good legibility for text or icons placed on top of a background |
| 34 |
of the corresponding color. |
| 35 |
|
| 36 |
Example of a Text on top of a background Rectangle: |
| 37 |
\qml |
| 38 |
Item { |
| 39 |
Rectangle { |
| 40 |
color: Theme.palette.normal.base |
| 41 |
} |
| 42 |
|
| 43 |
Text { |
| 44 |
color: Theme.palette.normal.baseText |
| 45 |
} |
| 46 |
} |
| 47 |
\endqml |
| 48 |
*/ |
| 49 |
QtObject { |
| 50 |
/*! |
| 51 |
Color palette to use when the widget is not in any particular state. |
| 52 |
*/ |
| 53 |
property PaletteValues normal |
| 54 |
/*! |
| 55 |
Color palette to use when the widget is selected, for example when |
| 56 |
a tab is the current one. |
| 57 |
*/ |
| 58 |
property PaletteValues selected |
| 59 |
} |