Commit 1b02c9d2 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Implement open/closed hand cursor for ImageDelegate

This will display an open hand cursor when over the main image that
changes to a closed hand cursor when actually dragging.
parent 8b5d939e
......@@ -19,6 +19,8 @@ Flickable {
property string currentImageSource
property string currentImageMimeType
property Item listView
contentWidth: width
contentHeight: height
boundsBehavior: Flickable.StopAtBounds
......@@ -233,8 +235,13 @@ Flickable {
onTriggered: applicationWindow().controlsVisible = !applicationWindow().controlsVisible
}
MouseArea {
id: mouse
anchors.fill: image
enabled: !currentImageMimeType.startsWith("video/")
cursorShape: pressed || flick.dragging || flick.listView.dragging ? Qt.ClosedHandCursor : Qt.OpenHandCursor
onClicked: {
contextDrawer.drawerOpen = false
doubleClickTimer.restart();
......
......@@ -578,7 +578,6 @@ Kirigami.Page {
}
MouseArea {
z: 1
anchors.fill: parent
acceptedButtons: Qt.BackButton | Qt.ForwardButton
......@@ -594,6 +593,7 @@ Kirigami.Page {
}
mouse.accepted = true
}
listView.positionViewAtIndex(listView.currentIndex, ListView.SnapPosition)
}
}
......@@ -664,6 +664,8 @@ Kirigami.Page {
currentImageMimeType: model.mimeType
width: listView.width
height: listView.height
listView: ListView.view
}
Controls.RoundButton {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment