forked from Shinonome/dots-hyprland
brightness service: more edging
This commit is contained in:
@@ -14,6 +14,7 @@ import QtQuick
|
|||||||
*/
|
*/
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
property real minimumBrightnessAllowed: 0.00001 // Setting to 0 would kind of turn off the screen. We don't want that.
|
||||||
|
|
||||||
signal brightnessChanged()
|
signal brightnessChanged()
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setBrightness(value: real): void {
|
function setBrightness(value: real): void {
|
||||||
value = Math.max(0.01, Math.min(1, value));
|
value = Math.max(root.minimumBrightnessAllowed, Math.min(1, value));
|
||||||
monitor.brightness = value;
|
monitor.brightness = value;
|
||||||
setTimer.restart();
|
setTimer.restart();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user