Dekko
Loading...
Searching...
No Matches
Style.qml
1/* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18pragma Singleton
19import QtQuick 2.4
20import QtQuick.Controls.Suru 2.2
21import Lomiri.Components 1.3
22
23QtObject {
24
25 // The defaults spacing is 2 gu around text, between icons etc... (That's a design rule btw!)
26 readonly property int defaultSpacing: units.gu(2)
27 readonly property int largeSpacing: (defaultSpacing * 2)
28 readonly property int smallSpacing: (defaultSpacing / 2)
29 // Used by line component.
30 readonly property int lineSize: units.dp(1)
31 readonly property color lineColor: Suru.neutralColor
32 readonly property color selectedHighlight: LomiriColors.blue
33 readonly property color windowColor: Suru.backgroundColor
34 property color colorDumb : "#FF00FF"; // magenta
35
36 readonly property int defaultIconSize: units.gu(2.5)
37 readonly property int largeIconSize: units.gu(3.5)
38 readonly property int smallIconSize: units.gu(1.5)
39
40 readonly property int defaultPanelWidth: units.gu(30)
41
42 readonly property color devPanelBackground: "#212121"
43
44 property Component highlightBar: Component {
45 Rectangle {
46 color: Qt.rgba(0, 0, 0, 0.05)
47 }
48 }
49
50 property Item _garbage_ : Item { }
51 property Component templateGradientShaded : Component {
52 Gradient {
53 id: autogradient;
54
55 property color baseColorTop : colorDumb;
56 property color baseColorBottom : colorDumb;
57
58 GradientStop { color: autogradient.baseColorTop; position: 0.0; }
59 GradientStop { color: autogradient.baseColorBottom; position: 1.0; }
60 }
61 }
62 function gradientShaded (baseColorTop, baseColorBottom) {
63 return templateGradientShaded.createObject (_garbage_, {
64 "baseColorTop" : (baseColorTop || selectedHighlight),
65 "baseColorBottom" : (baseColorBottom || windowColor),
66 });
67 }
68}
69