diff --git a/qmlUiKirigami/ImageViewer.qml b/qmlUiKirigami/ImageViewer.qml --- a/qmlUiKirigami/ImageViewer.qml +++ b/qmlUiKirigami/ImageViewer.qml @@ -23,7 +23,7 @@ import QtQuick 2.7 import QtQuick.Window 2.2 -import QtQuick.Controls 2.0 as Controls +import QtQuick.Controls 2.2 as Controls import org.kde.kirigami 2.0 as Kirigami import org.kde.koko 0.1 as Koko import org.kde.kquickcontrolsaddons 2.0 as KQA @@ -165,10 +165,12 @@ listView.positionViewAtIndex(currentIndex, ListView.Beginning) footerList.opacity = 1.0 timer.restart() + toolBar.visible = false } delegate: Flickable { id: flick + property alias currentImage: image width: imageWidth height: imageHeight contentWidth: imageWidth @@ -268,6 +270,10 @@ sourceSize.height: imageHeight * 2 MouseArea { anchors.fill: parent + onPressAndHold: { + if (root.state != "fullscreen") + toolBar.visible = true + } onDoubleClicked: { if (flick.interactive) { zoomAnim.x = 0; @@ -315,6 +321,7 @@ PathView { id: footerList + visible: root.state == "fullscreen" height: Kirigami.Units.gridUnit * 4 model: listView.model currentIndex: listView.currentIndex @@ -361,4 +368,29 @@ text: i18n("Back") onClicked: root.state = "closed" } + + Controls.ToolBar { + id: toolBar + visible: false + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + Row { + anchors.fill: parent + Controls.ToolButton { + text: i18n("Rotate left") + onClicked: listView.currentItem.currentImage.rotation -= 90 + } + Controls.ToolSeparator {} + Controls.ToolButton { + text: i18n("Rotate right") + onClicked: listView.currentItem.currentImage.rotation += 90 + } + Controls.ToolSeparator {} + Controls.ToolButton { + text: i18n("Hide") + onClicked: toolBar.visible = false + } + } + } }