-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.qml
81 lines (67 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
import QtQuick 2.7
Item {
id: root
FontLoader { id: poppinsSemibold; source: "qrc:/resources/fonts/Poppins-SemiBold.ttf" }
FontLoader { id: poppinsLight; source: "qrc:/resources/fonts/Poppins-Light.ttf" }
FontLoader { id: rubikLight; source: "qrc:/resources/fonts/Rubik-Light.ttf" }
// List of items
Rectangle {
width: parent.width * 0.25
height: parent.height
anchors.left: parent.left
color: "#222222"
Column {
id: menuList
anchors.fill: parent
anchors.topMargin: 60
spacing: 0
ListButton {
paneId: "workflow"
textLabel: "Workflow"
onClick: activatePane(paneId)
}
ListButton {
paneId: "lockscreen"
textLabel: "Lock screen"
onClick: activatePane(paneId)
}
ListButton {
paneId: "about"
textLabel: "About"
onClick: activatePane(paneId)
}
}
}
// Content pane
Item {
id: contentPane
width: parent.width * 0.75
height: parent.height
anchors.right: parent.right
WorkflowPane {
paneId: "workflow"
textLabel: "Workflow"
}
SettingsPane {
paneId: "lockscreen"
textLabel: "Lock screen"
}
AboutPane {
paneId: "about"
textLabel: "About"
}
}
function activatePane(paneId) {
var menuItems = menuList.children;
for (var i = 0 ; i < menuItems.length; i++) {
var menuItem = menuItems[i];
menuItem.active = (menuItem.paneId === paneId)
}
var panes = contentPane.children;
for (var i = 0 ; i < menuItems.length; i++) {
var pane = panes[i];
pane.active = (pane.paneId === paneId)
}
}
Component.onCompleted: activatePane("workflow")
}