This repository was archived by the owner on Jan 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.qml
105 lines (92 loc) · 1.62 KB
/
Settings.qml
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
101
102
103
104
105
import QtQuick 2.0
import Ubuntu.Components 0.1
import QtQuick.Window 2.2
Window {
id: settings
width: parent.width
height: parent.height
color: "white"
visible: false
ListModel {
id: clockModel
ListElement { name: "Default"; startTime: 30}
ListElement { name: "Blitz"; startTime: 10}
}
Component {
id: clockDelegate
Row {
id: fruit
width: settings.width
Text {
width: settings.width/2
anchors.left: settings.left
text: name;
font.pixelSize: 24
}
Text {
anchors.right: settings.right
text: "X"
font.pixelSize:24
MouseArea {
anchors.fill: parent
onClicked: {
clockModel.remove(index)
}
}
}
}
}
ListView {
anchors.fill: parent
//clip: true
width: settings.width
model: clockModel
delegate: clockDelegate
header: bannerComponent
}
Component {
id: bannerComponent
Rectangle {
id: banner
width: parent.width; height: 50
border {color: "#9EDDF2"; width: 2}
Text {
anchors.centerIn: parent
text: "Clocks available"
font.pixelSize:32
}
}
}
Editor {
id: clockEditor
visible: false
onAddClicked: {
clockModel.append({name: name, startTime: timer})
clockEditor.visible = false
}
}
Text {
id: addButton
text: "+"
font.pixelSize: 36
anchors.top: settings.top
anchors.left: settings.left
MouseArea {
anchors.fill: parent
onClicked: {
clockEditor.visible = true
}
}
}
Text {
id: goBackButton
text: "<"
font.pixelSize: 36
anchors.top: settings.top
anchors.left: addButton.right
MouseArea {
anchors.fill: parent
onClicked: settings.visible = false
}
}
}