From 2f9db12c1cadfe8c9ccb505f6bbee2567217d474 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 4 Oct 2017 20:26:32 +0200 Subject: [PATCH] change brightness only when slider is pressed call the service to change brightness only when the slider is pressed --- .../contents/ui/quicksettings/QuickSettings.qml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/containments/panel/package/contents/ui/quicksettings/QuickSettings.qml b/containments/panel/package/contents/ui/quicksettings/QuickSettings.qml index 3830f8f8..945bb756 100644 --- a/containments/panel/package/contents/ui/quicksettings/QuickSettings.qml +++ b/containments/panel/package/contents/ui/quicksettings/QuickSettings.qml @@ -39,13 +39,6 @@ Item { property int screenBrightness readonly property int maximumScreenBrightness: pmSource.data["PowerDevil"] ? pmSource.data["PowerDevil"]["Maximum Screen Brightness"] || 0 : 0 - onScreenBrightnessChanged: { - var service = pmSource.serviceForSource("PowerDevil"); - var operation = service.operationDescription("setBrightness"); - operation.brightness = screenBrightness; - operation.silent = true - service.startOperationCall(operation); - } PlasmaCore.DataSource { id: pmSource @@ -163,7 +156,11 @@ Item { value: root.screenBrightness onValueChanged: { if (pressed) { - root.screenBrightness = value + var service = pmSource.serviceForSource("PowerDevil"); + var operation = service.operationDescription("setBrightness"); + operation.brightness = value; + operation.silent = true + service.startOperationCall(operation); } } minimumValue: maximumValue > 100 ? 1 : 0