-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.qml
executable file
·77 lines (59 loc) · 1.41 KB
/
MainPage.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
import QtQuick 2.0
import Qt.labs.settings 1.0
import "."
Item {
id: root
state: "main"
property int tabX: 0
property int currentTheme: 1
transitions: [
Transition {
reversible: true
from: "main"
to: "options"
NumberAnimation {
target: root
property: "tabX"
}
}
]
states: [
State {
name: "main"
PropertyChanges {target: root; tabX: 0}
},
State {
name: "options"
PropertyChanges {target: root; tabX: -root.width}
}
]
MainWindow{
id: mainWindow
x: tabX
width: parent.width
height: parent.height
onTextChanged: mainWindow.text ? mainWindow.answerText = eval(mainWindow.text):""
onOptionsPressed: {
root.state = "options"
}
}
OptionsPage{
id: rect
x: tabX + parent.width
width: parent.width
height: parent.height
onThemeClicked: {
root.currentTheme = A
backPressed()
}
onBackPressed: root.state = "main"
}
onCurrentThemeChanged: Style.setTheme(root.currentTheme)
Settings {
id: settings
property alias rootCurrentTheme: root.currentTheme
}
Component.onCompleted: {
Style.setTheme(root.currentTheme)
}
}