mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 18:24:46 +00:00
change brightness only when slider is pressed
call the service to change brightness only when the slider is pressed
This commit is contained in:
parent
dfa4059a01
commit
2f9db12c1c
1 changed files with 5 additions and 8 deletions
|
|
@ -39,13 +39,6 @@ Item {
|
||||||
|
|
||||||
property int screenBrightness
|
property int screenBrightness
|
||||||
readonly property int maximumScreenBrightness: pmSource.data["PowerDevil"] ? pmSource.data["PowerDevil"]["Maximum Screen Brightness"] || 0 : 0
|
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 {
|
PlasmaCore.DataSource {
|
||||||
id: pmSource
|
id: pmSource
|
||||||
|
|
@ -163,7 +156,11 @@ Item {
|
||||||
value: root.screenBrightness
|
value: root.screenBrightness
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
if (pressed) {
|
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
|
minimumValue: maximumValue > 100 ? 1 : 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue