From 05e79946d678040b7b69f43844f5d83510f001da Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 4 Apr 2021 14:18:45 +0200 Subject: Add previous-next arrows (mga#28693) --- qml/mw-ui.qml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index 957923c..631852e 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -391,6 +391,68 @@ Rectangle { cacheBuffer: 200 } } + MouseArea { + id: nextMA + anchors {right: parent.right; verticalCenter: slideshow.verticalCenter } + width: 60 + height: 60 + hoverEnabled: true + onEntered: { rightArrow.state='Hovering'} + onExited: { rightArrow.state=''} + onClicked: {if (view.currentIndex < view.model.count - 1) + view.currentIndex = view.currentIndex + 1} + Rectangle { + id: rightArrow + anchors.fill: parent + color: "#80262F45" + visible: false + Text { + anchors.centerIn: parent + text: (direction == "LTR" ? ">" : "<") + font.pointSize: 30 + } + states: [ + State { + name: "Hovering" + PropertyChanges { + target: rightArrow + visible: view.currentIndex == view.model.count - 1 ? false : true + } + } + ] + } + } + MouseArea { + id: previousMA + anchors {left: parent.left; verticalCenter: slideshow.verticalCenter } + width: 60 + height: 60 + hoverEnabled: true + onEntered: { leftArrow.state='Hovering'} + onExited: { leftArrow.state=''} + onClicked: {if (view.currentIndex > 0) + view.currentIndex = view.currentIndex - 1} + Rectangle { + id: leftArrow + anchors.fill: parent + color: "#80262F45" + visible: false + Text { + anchors.centerIn: parent + text: (direction == "LTR" ? "<" : ">") + font.pointSize: 30 + } + states: [ + State { + name: "Hovering" + PropertyChanges { + target: leftArrow + visible: view.currentIndex == 0 ? false : true + } + } + ] + } + } Rectangle { id: buttonbox width: banner.width; height: buttonRow.height -- cgit v1.2.1