summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2016-02-09 21:38:59 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-09 13:05:05 -0800
commit0eebfb284eab0d9d2cea698e1be93d1edb1c47f1 (patch)
treece1716311e6c059de4cb8c6399ce9b49ad578359 /qt-mobile
parent37438e28d2f903d60e079bceb8d0ef4d20f45860 (diff)
downloadsubsurface-0eebfb284eab0d9d2cea698e1be93d1edb1c47f1.tar.gz
QML UI: Fix lingering edit mode
A dive would linger in edit mode when following these steps: start mobile. show theme info. click on dive in dive list. click edit. click back in topbar, again click back in the topbar. click on dive in dive list, still in edit mode. Not anymore. Also enable back button when viewing a dive. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qml/TopBar.qml11
1 files changed, 5 insertions, 6 deletions
diff --git a/qt-mobile/qml/TopBar.qml b/qt-mobile/qml/TopBar.qml
index 107b261d3..ec18298f5 100644
--- a/qt-mobile/qml/TopBar.qml
+++ b/qt-mobile/qml/TopBar.qml
@@ -83,11 +83,11 @@ Rectangle {
}
Item {
id: editButton
- anchors.right: contextDrawer.enabled ? contextMenu.left : parent.right
+ anchors.right: backButton.visible ? backButton.left : contextDrawer.enabled ? contextMenu.left : parent.right
anchors.top: parent.top
Layout.preferredHeight: editButtonIcon.height
width: editButtonIcon.width
- visible: !backButton.visible && detailsWindow.state === "view" && detailsWindow.visible
+ visible: detailsWindow.state === "view" && detailsWindow.visible
Image {
id: editButtonIcon
source: "qrc:/qml/menu-edit.png"
@@ -114,8 +114,7 @@ Rectangle {
anchors.top: parent.top
Layout.preferredHeight: backButtonIcon.height
width: backButtonIcon.width
- visible: logWindow.visible || themetest.visible ||
- (detailsWindow.state === "edit" && detailsWindow.visible)
+ visible: logWindow.visible || themetest.visible || detailsWindow.visible
Image {
id: backButtonIcon
source: "qrc:/qml/menu-back.png"
@@ -132,9 +131,9 @@ Rectangle {
height: parent.height
width: parent.width
onClicked: {
- if (logWindow.visible || themetest.visible)
+ if (detailsWindow.state === "view" || logWindow.visible || themetest.visible)
stackView.pop()
- else
+ if (detailsWindow.state === "edit")
detailsWindow.endEditMode()
}
}