Debian Codegraph @

src/imports/Components/Themes/2.0/Palette.qml

raw
1 /*
2 * Copyright 2015 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
18
19 /*!
20 \qmltype Palette
21 \inqmlmodule Lomiri.Components.Themes 1.0
22 \ingroup theme-module
23 \brief Provides the 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 in the default state.
52 */
53 property PaletteValues normal: PaletteValues{}
54
55 /*!
56 Color palette to use when the widget is in the disabled (enabled: false)
57 state.
58 \since Lomiri.Components.Themes 1.3
59 */
60 property PaletteValues disabled: PaletteValues{}
61
62 /*!
63 Color palette to use when the widget is focused.
64 */
65 property PaletteValues focused: PaletteValues{}
66
67 /*!
68 Color palette to use when the widget is selected, for example when
69 a tab is the current one.
70 */
71 property PaletteValues selected: PaletteValues{}
72
73 /*!
74 Color palette to use when the widget is selected and disabled.
75 \since Lomiri.Components.Themes 1.3
76 */
77 property PaletteValues selectedDisabled: PaletteValues{}
78
79 /*!
80 Color palette values to use when the widget is highlighted.
81 \since Lomiri.Components.Themes 1.3
82 */
83 property PaletteValues highlighted: PaletteValues{}
84 }