1
+ /*
2
+ * Papyros Shell - The desktop shell for Papyros following Material Design
3
+ * Copyright (C) 2015 Michael Spencer
4
+ * 2015 Bogdan Cuza
5
+ * 2015 Ricardo Vieira
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
1
21
import QtQuick 2.0
2
22
import Material 0.1
3
23
import Material.Extras 0.1
4
- import Material.ListItems 0.1 as ListItem
5
- import Material.Desktop 0.1
6
24
7
25
View {
8
26
fullHeight: true
@@ -28,71 +46,97 @@ View {
28
46
29
47
property var widgets: [" Music" ]
30
48
31
- Column {
49
+ View {
50
+ id: view
51
+ height: label .height + units .dp (16 )
32
52
width: parent .width
53
+ backgroundColor: " #fafafa"
54
+ z: 10
33
55
34
- spacing: units .dp (16 )
35
-
36
- View {
37
- id: view
38
- height: label .height + units .dp (16 )
39
- width: parent .width
40
-
41
- Label {
42
- id: label
43
- anchors {
44
- left: parent .left
45
- right: parent .right
46
- bottom: parent .bottom
47
- leftMargin: units .dp (16 )
48
- rightMargin: units .dp (16 )
49
- }
50
-
51
- text: Qt .formatDateTime (now, " dddd',<br>'MMMM d'<sup>%1</sup>'"
52
- .arg (Utils .nth (now .getDate ())))
53
-
54
- style: " title"
55
- font .pixelSize : units .dp (30 )
56
- textFormat: Text .RichText
56
+ Label {
57
+ id: label
58
+ anchors {
59
+ left: parent .left
60
+ right: parent .right
61
+ bottom: parent .bottom
62
+ leftMargin: units .dp (16 )
63
+ rightMargin: units .dp (16 )
57
64
}
58
- }
59
65
60
- Repeater {
61
- model: widgets
62
- delegate: Loader {
63
- source: Qt .resolvedUrl (" ../widgets/%1.qml" .arg (modelData))
66
+ text: Qt .formatDateTime (now, " dddd',<br>'MMMM d'<sup>%1</sup>'"
67
+ .arg (Utils .nth (now .getDate ())))
64
68
65
- anchors {
66
- left: parent .left
67
- right: parent .right
68
- margins: units .dp (16 )
69
- }
70
- }
69
+ style: " title"
70
+ font .pixelSize : units .dp (30 )
71
+ textFormat: Text .RichText
71
72
}
72
73
}
73
74
74
- Item {
75
+ Flickable {
75
76
anchors {
77
+ top: view .bottom
76
78
left: parent .left
77
79
right: parent .right
78
- bottom: parent .bottom
79
- margins : units .dp (16 )
80
+ bottom: silentMode .bottom
81
+ topMargin : units .dp (16 )
80
82
}
83
+ z: 5
84
+ contentHeight: widgetCol .height
85
+ interactive: contentHeight > height
86
+ boundsBehavior: Flickable .StopAtBounds
81
87
82
- height: units .dp (30 )
88
+ Column {
89
+ id: widgetCol
83
90
84
- Label {
85
- anchors .verticalCenter : parent .verticalCenter
91
+ width: parent .width
86
92
87
- text: " Silent mode"
93
+ Repeater {
94
+ model: widgets
95
+ delegate: Loader {
96
+ source: Qt .resolvedUrl (" ../widgets/%1.qml" .arg (modelData))
97
+
98
+ anchors {
99
+ left: parent .left
100
+ right: parent .right
101
+ margins: units .dp (16 )
102
+ }
103
+ }
104
+ }
88
105
}
106
+ }
107
+
108
+ Rectangle {
109
+ id: silentMode
110
+
111
+ anchors .bottom : parent .bottom
112
+ height: units .dp (46 )
113
+ width: parent .width
114
+ color: " #fafafa"
115
+ z: 10
116
+
117
+ Rectangle {
118
+ anchors {
119
+ left: parent .left
120
+ right: parent .right
121
+ bottom: parent .bottom
122
+ margins: units .dp (16 )
123
+ }
124
+
125
+ height: units .dp (30 )
89
126
90
- Switch {
91
- anchors .verticalCenter : parent .verticalCenter
92
- anchors .right : parent .right
127
+ Label {
128
+ anchors .verticalCenter : parent .verticalCenter
93
129
94
- checked: config .silentMode
95
- onCheckedChanged: config .silentMode = checked
130
+ text: " Silent mode"
131
+ }
132
+
133
+ Switch {
134
+ anchors .verticalCenter : parent .verticalCenter
135
+ anchors .right : parent .right
136
+
137
+ checked: config .silentMode
138
+ onCheckedChanged: config .silentMode = checked
139
+ }
96
140
}
97
141
}
98
142
}
0 commit comments