summaryrefslogtreecommitdiff
path: root/src/frontend/qtquick/main.qml
blob: 2a942d0c28fe1019fa7cf37b544bb1aa93944e47 (plain)
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
import QtQuick 2.15
import QtQuick.Controls 2.15

ApplicationWindow {
	width: 640
	height: 480
	visible: true
	title: PROJECT_TITLE
	
	id: root

	Drawer {
		id: drawer

		width: Math.min(root.width, root.height) / 3 * 2
		height: root.height

		ListView {
			currentIndex: -1
			anchors.fill: parent

			delegate: ItemDelegate {
				width: parent.width
				text: model.text
				highlighted: ListView.isCurrentItem
				onClicked: {
					drawer.close()
					model.triggered()
				}
			}

			model: ListModel {
				ListElement {
					text: qsTr("Preferences...")
					triggered: function() { preferencesDialog.open(); }
				}
				ListElement {
					text: qsTr("Reload...")
					triggered: function() { /* reload from database */ }
				}
				ListElement {
					text: qsTr("About...")
					triggered: function() { aboutDialog.open() }
				}
			}

			ScrollIndicator.vertical: ScrollIndicator { }
		}
	}

	header: ToolBar {
		ToolButton {
			id: menuButton
			anchors.left: parent.left
			anchors.verticalCenter: parent.verticalCenter
			// TODO create icon for the drawer
			//icon.source: "..."
			onClicked: drawer.open()
		}
		Label {
			anchors.centerIn: parent
			// TODO determine what title to set
			//text: ...
			font.pixelSize: 20
			elide: Label.ElideRight
		}
	}


	// DropDown for groups (including an "all" option)
	Item {
		width: parent.width
		height: 50
		ComboBox {
			anchors.fill: parent
			id: groupComboBox
			model: [
				"all"
				//...
			]
		}
	}
}