-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapplication.qml
114 lines (104 loc) · 2.48 KB
/
application.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
import QtQuick 2.2
import QtQuick.Controls 1.3
import "./components"
ApplicationWindow {
visible: true
width: 1200
height: 700
x: 40
y: 50
Rectangle {
color: "#212126"
anchors.fill: parent
}
toolBar: BorderImage {
border.bottom: 8
source: "images/toolbar.png"
width: parent.width
height: 100
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
opacity: stackView.depth > 1 ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"
Behavior on opacity { NumberAnimation{} }
Image {
anchors.verticalCenter: parent.verticalCenter
source: "images/navigation_previous_item.png"
}
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -20
onClicked: stackView.pop()
}
}
Text {
font.pixelSize: 42
Behavior on x { NumberAnimation{ easing.type: Easing.OutCubic} }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
color: "white"
text: "Algorithm Simulator"
}
}
ListModel {
id: pageModel
ListElement {
title: "BitWise"
page: "content/bitmask/BitWise.qml"
}
ListElement {
title: "Data Structures"
page: "content/datastructure/DSMenu.qml"
}
ListElement {
title: "Graphs"
page: "content/graph/GraphMenu.qml"
}
ListElement {
title: "Sorting"
page: "content/sorting/SortMenu.qml"
}
ListElement {
title: "Tree Traversal"
page: "content/tree/TreeMenu.qml"
}
ListElement {
title: "About"
page: "content/about.qml"
}
}
StackView {
id: stackView
anchors.fill: parent
// Implements back key navigation
focus: true
Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) {
stackView.pop();
event.accepted = true;
}
initialItem: Item {
width: parent.width
height: parent.height
ListView {
width: parent.width
height: parent.height
model: pageModel
anchors.centerIn: parent
delegate: MenuDelegate {
text: title
onClicked: {
stackView.push(Qt.resolvedUrl(page))
}
}
}
}
}
}