summaryrefslogtreecommitdiff
path: root/src/extras/Styles/Flat/FlatStyle.qml
blob: 60e03d4e4f77a59753a3d678e9c607bbaed4cf7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
pragma Singleton

import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Private 1.0

QtObject {
    readonly property string fontFamily: __openSansRegularLoader.name

    readonly property color backgroundColor: "#ffffff"
    readonly property color defaultTextColor: "#333333"
    readonly property color styleColor: "#5caa15"
    readonly property color strokeColor: "#328930"
    readonly property color hoveredColor: "#7dbb44"
    readonly property color focusedColor: "#4da6d8"
    readonly property color focusedTextColor: "#1288cb"
    readonly property color focusedAndPressedColor: "#4595c2"
    readonly property color focusedStrokeColor: "#2f86bb"
    readonly property color focusedAndPressedStrokeColor: "#266b96"
    readonly property color checkedFocusedAndPressedColor: "#3a7ca2"
    readonly property color checkedAndPressedColor: "#4a8811"
    readonly property color checkedAndPressedColorAlt: "#3c6f0e"
    readonly property color pressedColor: "#457f10"
    readonly property color pressedColorAlt: "#539913"
    readonly property color pressedStrokeColor: "#286e26"
    readonly property color invalidColor: "#dd0000"
    readonly property color disabledColor: "#000000"
    readonly property color disabledFillColor: "#d9d9d9"
    readonly property color highlightColor: "#4da6d8"
    readonly property color selectedTextColor: "#ffffff"
    readonly property color textSelectionColor: "#ceeaff"
    readonly property color textColor: "#1a1a1a"
    readonly property color grooveColor: "#14000000"
    readonly property color lightFrameColor: "#cccccc"
    readonly property color mediumFrameColor: "#b3b3b3"
    readonly property color darkFrameColor: "#999999"
    readonly property color alphaFrameColor: "#33000000"
    readonly property color selectionHandleColor: "#0668ec"
    readonly property color flatFrameColor: "#f2f2f2"
    readonly property real disabledOpacity: 0.3
    readonly property real defaultFontSize: 13

    // 16 is the implicitHeight of text on a PC monitor. This should scale well
    // to other devices. For example, if the implicitHeight is 64 on a touch
    // device, the scale factor will be x4.
    readonly property real scaleFactor: Math.max(1, TextSingleton.implicitHeight / 16)

    readonly property real onePixel: Math.max(1, Math.round(scaleFactor * 1))
    readonly property real twoPixels: Math.max(2, Math.round(scaleFactor * 2))
    readonly property int radius: Math.round(scaleFactor * 3)

    property FontLoader __openSansDemiBoldLoader: FontLoader {
        source: "fonts/OpenSans-Semibold.ttf"
    }

    property FontLoader __openSansRegularLoader: FontLoader {
        source: "fonts/OpenSans-Regular.ttf"
    }

    property FontLoader __openSansLightLoader: FontLoader {
        source: "fonts/OpenSans-Light.ttf"
    }

    readonly property int __renderType: Text.QtRendering
}