summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-07-30 16:52:41 -0400
committerLouie S <louie@example.com>2024-07-30 16:52:41 -0400
commitd59356ea7e5f3ab01695f936a409a433deac751b (patch)
tree689603e9ee6be5b8cd0c014d17badebc3dc54c3a /src
parent1e02a8b37e2dc74e2d868e818e03e4dda39f4079 (diff)
Create ApplicationWindow with menuqtquick
Diffstat (limited to 'src')
-rw-r--r--src/frontend/qtquick/main.qml64
1 files changed, 61 insertions, 3 deletions
diff --git a/src/frontend/qtquick/main.qml b/src/frontend/qtquick/main.qml
index 3775f2b..2a942d0 100644
--- a/src/frontend/qtquick/main.qml
+++ b/src/frontend/qtquick/main.qml
@@ -1,13 +1,71 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
-import QtQuick.Window 2.15
-Window {
+ApplicationWindow {
width: 640
height: 480
visible: true
- // TODO grab this from config.h
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 {