diff options
author | Henrik Brautaset Aronsen <subsurface@henrik.synth.no> | 2016-02-07 22:23:06 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-07 13:56:07 -0800 |
commit | d9763100940cbcff297d88a0f1597ba7bd07ea01 (patch) | |
tree | 5cb08483e2a79021e3872a3f4332c80c0216f7b8 /qt-mobile/qml/TopBar.qml | |
parent | e1743896185dc0313ccac8aa5c8d58abf1cc2b62 (diff) | |
download | subsurface-d9763100940cbcff297d88a0f1597ba7bd07ea01.tar.gz |
Add top-right edit and back buttons for mobile
Adds a back button in edit mode, and an edit button for view mode.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/TopBar.qml')
-rw-r--r-- | qt-mobile/qml/TopBar.qml | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/qt-mobile/qml/TopBar.qml b/qt-mobile/qml/TopBar.qml index 5eeef7da8..4f3f6fef8 100644 --- a/qt-mobile/qml/TopBar.qml +++ b/qt-mobile/qml/TopBar.qml @@ -82,6 +82,67 @@ Rectangle { Layout.fillWidth: true } Item { + id: editButton + anchors.right: parent.right + anchors.top: parent.top + Layout.preferredHeight: editButtonIcon.height + width: editButtonIcon.width + visible: (detailsWindow.state === "view" && detailsWindow.visible) + Image { + id: editButtonIcon + source: "qrc:/qml/menu-edit.png" + anchors { + top: parent.top + right: parent.right + topMargin: MobileComponents.Units.smallSpacing * -1 + rightMargin: MobileComponents.Units.smallSpacing + } + width: Math.round(MobileComponents.Units.gridUnit * 1.7) + height: width + } + MouseArea { + height: parent.height + width: parent.width + onClicked: { + detailsWindow.open() + } + } + MouseArea { + height: parent.height + width: parent.width + onClicked: { + detailsWindow.startEditMode() + } + } + } + Item { + id: backButton + anchors.right: parent.right + anchors.top: parent.top + Layout.preferredHeight: backButtonIcon.height + width: backButtonIcon.width + visible: (detailsWindow.state === "edit" && detailsWindow.visible) + Image { + id: backButtonIcon + source: "qrc:/qml/menu-back.png" + anchors { + top: parent.top + right: parent.right + topMargin: MobileComponents.Units.smallSpacing * -1 + rightMargin: MobileComponents.Units.smallSpacing + } + width: Math.round(MobileComponents.Units.gridUnit * 1.7) + height: width + } + MouseArea { + height: parent.height + width: parent.width + onClicked: { + endEditMode() + } + } + } + Item { id: contextMenu visible: contextDrawer.enabled anchors.right: parent.right @@ -108,6 +169,5 @@ Rectangle { } } } - } } |