diff --git a/qmlUiKirigami/ImageViewer.qml b/qmlUiKirigami/ImageViewer.qml --- a/qmlUiKirigami/ImageViewer.qml +++ b/qmlUiKirigami/ImageViewer.qml @@ -24,6 +24,7 @@ import QtQuick 2.7 import QtQuick.Window 2.2 import QtQuick.Controls 2.0 as Controls +import QtGraphicalEffects 1.0 as Effects import org.kde.kirigami 2.0 as Kirigami import org.kde.koko 0.1 as Koko import org.kde.kquickcontrolsaddons 2.0 as KQA @@ -50,6 +51,24 @@ title: i18n("Edit image") handleVisible: true } + + Controls.Slider { + id: brightnessSlider + orientation: Qt.Vertical + anchors.right: listView.right + height: root.height - (Kirigami.Units.gridUnit * 6) + visible: applicationWindow().controlsVisible + from: 0 + to: 1.0 + value: 0.5 + z: listView.z + 1 + hoverEnabled: true + Controls.ToolTip { + parent: brightnessSlider + visible: brightnessSlider.hovered + text: i18n("Brightness Controller") + } + } actions { left: Kirigami.Action { @@ -146,14 +165,15 @@ onCurrentIndexChanged: { currentImage.index = model.sourceIndex( currentIndex) listView.positionViewAtIndex(currentIndex, ListView.Beginning) - + root.slider.value = 0.5 shareDialog.close(); } delegate: Flickable { id: flick property alias currentImageSource: image.source property alias image: image + property alias brightnessContrast: brightnessContrast width: imageWidth height: imageHeight contentWidth: imageWidth @@ -304,6 +324,13 @@ } } } + + Effects.BrightnessContrast { + id: brightnessContrast + source: image + anchors.fill: image + brightness: brightnessSlider.value - 0.5 + } } } }