~stefan-schwarzburg/qreator/touch-reorganized-colortheme

« back to all changes in this revision

Viewing changes to qreator/ThemePage.qml

  • Committer: Stefan Schwarzburg
  • Date: 2013-06-13 09:13:52 UTC
  • Revision ID: stefan.schwarzburg@gmail.com-20130613091352-w3olbgn62ubcirdk
Started to implement a color theme selector. 

Working so far: change foreground color of the standard theme by moving rgb sliders in the theme-page.
Not working: changing background color; changing main or eye theme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
import Ubuntu.Components 0.1
 
3
import Ubuntu.Components.ListItems 0.1 as ListItem
 
4
import Ubuntu.Components.Popups 0.1
 
5
import QtGraphicalEffects 1.0
 
6
 
 
7
 
 
8
Page {
 
9
    id: root
 
10
    title: i18n.tr("Themes")
 
11
    visible: false
 
12
    
 
13
    Column {
 
14
        anchors.fill: parent
 
15
 
 
16
        ListItem.ValueSelector {
 
17
            text: "Main theme"
 
18
            values: ["Standard"]
 
19
        }
 
20
        ListItem.ValueSelector {
 
21
            text: "Eye theme"
 
22
            values: ["Standard"]
 
23
        }
 
24
        ListItem.Empty {
 
25
            height: units.gu(20)
 
26
            
 
27
            UbuntuShape {
 
28
                id: backgroundColor
 
29
                anchors.left: parent.left
 
30
                anchors.top: parent.top
 
31
                anchors.leftMargin: units.gu(3)
 
32
                anchors.topMargin: units.gu(3)
 
33
                color: standardTheme.background
 
34
                radius: "medium"
 
35
            }
 
36
            UbuntuShape {
 
37
                id: foregroundColor
 
38
                anchors.left: parent.left
 
39
                anchors.top: parent.top
 
40
                anchors.leftMargin: units.gu(8)
 
41
                anchors.topMargin: units.gu(8)
 
42
                color: standardTheme.foreground
 
43
                radius: "medium"
 
44
            }
 
45
            Column {
 
46
                id: sliders
 
47
                width: parent.width - units.gu(20)
 
48
                anchors.topMargin: units.gu(1)
 
49
                anchors.right: parent.right
 
50
                anchors.top: parent.top
 
51
                spacing: units.gu(1)
 
52
 
 
53
                Row {
 
54
                    spacing: units.gu(1)
 
55
                    Label {
 
56
                        text: i18n.tr("Red")
 
57
                        width: units.gu(4)
 
58
                        fontSize: "medium"
 
59
                        anchors.verticalCenter: parent.verticalCenter
 
60
                        color: "red"
 
61
                    }
 
62
                    Slider {
 
63
                        id: redSlider
 
64
                        width: sliders.width - units.gu(5)
 
65
                        minimumValue: 0
 
66
                        maximumValue: 255
 
67
                        value: 0.0
 
68
                        live: true
 
69
                        onValueChanged: {
 
70
                            standardTheme.foreground.r = value / 255
 
71
                            qrcanvastext.requestQrCodePaint(qrcanvastext.text)
 
72
                        }
 
73
                    }
 
74
                }
 
75
                Row {
 
76
                    spacing: units.gu(1)
 
77
                    Label {
 
78
                        text: i18n.tr("Green")
 
79
                        width: units.gu(4)
 
80
                        fontSize: "medium"
 
81
                        anchors.verticalCenter: parent.verticalCenter
 
82
                        color: "green"
 
83
                    }
 
84
 
 
85
                    Slider {
 
86
                        id: greenSlider
 
87
                        width: sliders.width - units.gu(5)
 
88
                        minimumValue: 0
 
89
                        maximumValue: 255
 
90
                        value: 0.0
 
91
                        live: true
 
92
                        onValueChanged: {
 
93
                            standardTheme.foreground.g = value / 255
 
94
                            qrcanvastext.requestQrCodePaint(qrcanvastext.text)
 
95
                        }
 
96
                    }
 
97
                }
 
98
                Row {
 
99
                    spacing: units.gu(1)
 
100
                    Label {
 
101
                        text: i18n.tr("Blue")
 
102
                        width: units.gu(4)
 
103
                        fontSize: "medium"
 
104
                        anchors.verticalCenter: parent.verticalCenter
 
105
                        color: "blue"
 
106
                    }
 
107
                    Slider {
 
108
                        id: blueSlider
 
109
                        width: sliders.width - units.gu(5)
 
110
                        minimumValue: 0
 
111
                        maximumValue: 255
 
112
                        value: 0.0
 
113
                        live: true
 
114
                        onValueChanged: {
 
115
                            standardTheme.foreground.b = value / 255
 
116
                            qrcanvastext.requestQrCodePaint(qrcanvastext.text)
 
117
                        }
 
118
 
 
119
                    }
 
120
                }
 
121
            }
 
122
        }
 
123
        ListItem.SingleControl {
 
124
            height: units.gu(28)
 
125
            QrCodeCanvas {
 
126
                id: qrcanvastext
 
127
                anchors.centerIn: parent
 
128
                width: units.gu(24)
 
129
                height: units.gu(24)
 
130
            }
 
131
        }
 
132
    }
 
133
}
 
 
b'\\ No newline at end of file'