-
Notifications
You must be signed in to change notification settings - Fork 110
/
main.qml
96 lines (90 loc) · 2.58 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
import QtQuick 2.3
import QtQuick.Controls 1.2
import "src/lists"
import "src/bars"
import "src/buttons"
import "src/variables/fontawesome.js" as FontAwesome
ApplicationWindow {
visible: true
width: 800
height: 1280
FontLoader{ source: "qrc:/src/fonts/fontawesome-webfont.ttf"}
Rectangle {
anchors.fill: parent
}
toolBar: Bar{
id: titleBar
leftComponent: Component{
ButtonDefault{
class_name: "bar dark clear"
text: "Back"
icon: FontAwesome.icons.fa_angle_left
opacity: stackView.depth > 1 ? 1 : 0
visible: opacity ? true : false
Behavior on opacity { NumberAnimation{} }
onClicked: {
stackView.pop()
titleBar.title = "Qml Bootstrap Demo"
}
}
}
class_name: "header"
title: "Qml Bootstrap Demo"
}
ListModel {
id: pageModel
ListElement {
text: "Buttons Demo"
page: "src/examples/ButtonPage.qml"
}
ListElement {
text: "ListView Demo"
page: "src/examples/DefaultListPage.qml"
}
ListElement {
text: "ListView with icon Demo"
page: "src/examples/IconListPage.qml"
}
ListElement {
text: "Avatar ListView Demo"
page: "src/examples/AvatarListPage.qml"
}
ListElement {
text: "Thumnail ListView Demo"
page: "src/examples/ThumbnailListPage.qml"
}
ListElement {
text: "Button bar Demo"
page: "src/examples/ButtonBarPage.qml"
}
ListElement {
text: "Card"
page: "src/examples/CardPage.qml"
}
}
StackView {
id: stackView
anchors.fill: parent
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
DefaultListView{
model: pageModel
anchors.fill: parent
onItemClicked: {
stackView.push(Qt.resolvedUrl(item.page))
titleBar.title = item.text
}
}
}
}
statusBar: Bar{
class_name: "footer calm"
title: "Powered by Brexis and Kamhix"
}
}