mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
e174389618
commit
d976310094
5 changed files with 92 additions and 25 deletions
|
|
@ -81,6 +81,67 @@ Rectangle {
|
|||
Item {
|
||||
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
|
||||
|
|
@ -108,6 +169,5 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue