From 0eebfb284eab0d9d2cea698e1be93d1edb1c47f1 Mon Sep 17 00:00:00 2001 From: Henrik Brautaset Aronsen Date: Tue, 9 Feb 2016 21:38:59 +0100 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- qt-mobile/qml/TopBar.qml | 11 +++++------ 1 file 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() } }