summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2015-07-26 12:48:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-26 06:19:43 -0700
commitf1f13ed4072683901b11cb34bd1c9ad40e1e2cfa (patch)
tree0c3aca864f3d5ff29ff1ad1a9d367de00a9c23d6 /qt-mobile
parent83c2addfef473dc7b463156272e598f88c798c9c (diff)
downloadsubsurface-f1f13ed4072683901b11cb34bd1c9ad40e1e2cfa.tar.gz
QML UI: create menu to house the buttons
Runing the android version on a phone the screen must be tilted sideways to accommodate all buttons. This creates a single button that triggers a popup menu that houses the buttons. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/main.qml64
1 files changed, 37 insertions, 27 deletions
diff --git a/qt-mobile/main.qml b/qt-mobile/main.qml
index 9553197b6..812a27429 100644
--- a/qt-mobile/main.qml
+++ b/qt-mobile/main.qml
@@ -11,6 +11,38 @@ ApplicationWindow {
property alias messageText: message.text
visible: true
+ Menu {
+ id: prefsMenu
+ title: "Menu"
+
+ MenuItem {
+ text: "Preferences"
+ onTriggered: {
+ stackView.push(prefsWindow)
+ }
+ }
+
+ MenuItem {
+ text: "Load Dives"
+ onTriggered: {
+ manager.loadDives();
+ }
+ }
+
+ MenuItem {
+ text: "Download Dives"
+ onTriggered: {
+ stackView.push(downloadDivesWindow)
+ }
+ }
+ MenuItem {
+ text: "Save Changes"
+ onTriggered: {
+ manager.saveChanges();
+ }
+ }
+ }
+
StackView {
id: stackView
anchors.fill: parent
@@ -39,39 +71,17 @@ ApplicationWindow {
anchors.bottomMargin: prefsButton.height * 0.1
anchors.left: topPart.left
anchors.leftMargin: prefsButton.height * 0.1
+ anchors.right: topPart.right
+ anchors.rightMargin: prefsButton.height * 0.1
Button {
id: prefsButton
- text: "Preferences"
- onClicked: {
- stackView.push(prefsWindow)
- }
- }
-
- Button {
- id: loadDivesButton
- text: "Load Dives"
+ text: "\u22ee"
+ anchors.right: parent.right
onClicked: {
- manager.loadDives();
+ prefsMenu.popup()
}
}
- Button {
- id: downloadDivesButton
- text: "Download Dives"
- onClicked: {
- downloadDivesWindow.height = parent.height
- downloadDivesWindow.width = parent.width
- stackView.push(downloadDivesWindow)
- }
- }
-
- Button {
- id: saveChanges
- text: "Save Changes"
- onClicked: {
- manager.saveChanges();
- }
- }
}
}