mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
83c2addfef
commit
f1f13ed407
1 changed files with 37 additions and 27 deletions
|
@ -11,6 +11,38 @@ ApplicationWindow {
|
||||||
property alias messageText: message.text
|
property alias messageText: message.text
|
||||||
visible: true
|
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 {
|
StackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -39,39 +71,17 @@ ApplicationWindow {
|
||||||
anchors.bottomMargin: prefsButton.height * 0.1
|
anchors.bottomMargin: prefsButton.height * 0.1
|
||||||
anchors.left: topPart.left
|
anchors.left: topPart.left
|
||||||
anchors.leftMargin: prefsButton.height * 0.1
|
anchors.leftMargin: prefsButton.height * 0.1
|
||||||
|
anchors.right: topPart.right
|
||||||
|
anchors.rightMargin: prefsButton.height * 0.1
|
||||||
Button {
|
Button {
|
||||||
id: prefsButton
|
id: prefsButton
|
||||||
text: "Preferences"
|
text: "\u22ee"
|
||||||
|
anchors.right: parent.right
|
||||||
onClicked: {
|
onClicked: {
|
||||||
stackView.push(prefsWindow)
|
prefsMenu.popup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
|
||||||
id: loadDivesButton
|
|
||||||
text: "Load Dives"
|
|
||||||
onClicked: {
|
|
||||||
manager.loadDives();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue