-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
184 lines (149 loc) · 4.38 KB
/
main.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import QtQuick 2.9
import QtQuick.Controls 2.2
import com.opus.components 1.0
ApplicationWindow {
id: window
visible: true
width: 640
height: 480
title: "Opus"
Drawer {
id: drawer
width: window.width * 0.3
height: window.height
Column {
anchors.fill: parent
Item {
width: 1 // dummy value != 0
height: 50
}
RoundButton {
icon.source: "images/img_user.png"
icon.width: 80
icon.height: 80
anchors.horizontalCenter: parent.horizontalCenter
}
Text{
text: "Mr. Opus"
font.pixelSize: Qt.application.font.pixelSize * 1.3
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
color: "white"
}
Text{
text: "20, Male, Shanghai"
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 30
color: "white"
}
Item {
width: 1 // dummy value != 0
height: 20
}
ItemDelegate {
text: "Resume"
icon.source: "images/img_resume.png"
icon.width: 16
icon.height: 16
width: parent.width
onClicked: {
drawer.close()
}
}
ItemDelegate {
text: "Restart"
icon.source: "images/img_restart.png"
icon.width: 16
icon.height: 16
width: parent.width
onClicked: {
scribbleArea.restart();
drawer.close()
}
}
ItemDelegate {
text: "Stop"
icon.source: "images/img_stop.png"
icon.width: 16
icon.height: 16
width: parent.width
onClicked: {
scribbleArea.stop();
goButton.visible = true;
drawer.close()
}
}
ItemDelegate {
text: "Diary"
icon.source: "images/img_diary.png"
icon.width: 16
icon.height: 16
width: parent.width
onClicked: {
stackView.push("diary.qml")
drawer.close()
}
}
ItemDelegate {
text: "Share"
icon.source: "images/img_share.png"
icon.width: 16
icon.height: 16
width: parent.width
onClicked: {
stackView.push("share.qml")
drawer.close()
}
}
ItemDelegate {
text: "Settings"
icon.source: "images/img_settings.png"
icon.width: 16
icon.height: 16
width: parent.width
onClicked: {
// stackView.push("Page2Form.ui.qml")
drawer.close()
}
}
}
}
StackView {
id: stackView
initialItem: Rectangle{
ScribbleArea{
id: scribbleArea
anchors.fill: parent
paused: drawer.opened || goButton.visible || stackView.depth > 1
}
RoundButton {
id: goButton
anchors.centerIn: parent
width: 200
height: 200
text: "\u25B6"
font.pixelSize: Qt.application.font.pixelSize * 5
onClicked: {
goButton.visible = false;
}
}
}
anchors.fill: parent
}
ToolButton {
id: toolButton
anchors.left: parent.left
anchors.top: parent.top
width: 75
height: 75
text: stackView.depth > 1 ? "\u25C0" : "\u2630"
font.pixelSize: Qt.application.font.pixelSize * 1.6
onClicked: {
if(stackView.depth == 1){
drawer.open()
}else{
stackView.pop();
}
}
}
}