Debian Codegraph @

src/imports/Components/Themes/SuruDark/1.3/Palette.qml

raw
1 /*
2 * Copyright 2016 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 //![0]
18 import QtQuick 2.4
19 import Lomiri.Components 1.3
20 import Lomiri.Components.Themes 1.3
21
22 Palette {
23 normal: SuruDarkNormal {}
24 disabled: SuruDarkNormal {
25 Component.onCompleted: {
26 // specific disabled colors
27 var diff = {
28 raised: "#FFFFFF",
29 positiveText: LomiriColors.porcelain,
30 negativeText: LomiriColors.porcelain,
31 activityText: LomiriColors.inkstone,
32 focusText: LomiriColors.inkstone,
33 selectionText: "#FFFFFF"
34 };
35 for (var p in normal) {
36 // skip objectName and all change signals
37 if (p == "objectName"|| p.indexOf("Changed") > 0) continue;
38 disabled[p] = diff[p] || (
39 // if not specific, colors are 40% opaque normal
40 Qt.rgba(normal[p].r, normal[p].g, normal[p].b, normal[p].a * 0.4)
41 );
42 }
43 }
44 }
45
46 // selected differs from normal in background, base, foreground
47 selected: SuruDarkSelected {}
48
49 // selected differs from normal in background, base, foreground
50 selectedDisabled: SuruDarkSelected {
51 Component.onCompleted: {
52 var diff = {
53 background: LomiriColors.inkstone,
54 backgroundText: "#FFFFFF",
55 raised: "#FFFFFF",
56 foregroundText: "#FFFFFF",
57 overlayText: "#FFFFFF",
58 fieldText: "#FFFFFF",
59 selectionText: "#FFFFFF",
60 positiveText: LomiriColors.porcelain,
61 negativeText: LomiriColors.porcelain,
62 activityText: LomiriColors.jet,
63 focusText: LomiriColors.jet,
64 position: "#00000000"
65 };
66 for (var p in selected) {
67 // skip objectName and all change signals
68 if (p == "objectName"|| p.indexOf("Changed") > 0) continue;
69 selectedDisabled[p] = diff[p] || (
70 // if not specific, colors are 30% opaque normal
71 Qt.rgba(selected[p].r, selected[p].g, selected[p].b, normal[p].a * 0.5)
72 );
73 }
74 }
75 }
76
77 highlighted: SuruDarkNormal {
78 background: LomiriColors.slate
79 base: LomiriColors.slate
80 baseText: LomiriColors.silk
81 foreground: LomiriColors.slate
82 raised: LomiriColors.silk
83 raisedText: LomiriColors.inkstone
84 raisedSecondaryText: LomiriColors.ash
85 }
86
87 focused: SuruDarkNormal {
88 background: Qt.rgba(LomiriColors.lightBlue.r, LomiriColors.lightBlue.g, LomiriColors.lightBlue.b, 0.4)
89 }
90 }
91 //![0]