feat!: support exponential brightness curve

I don't need most of the fluff for handling other types of displays, and getting rid of it lets me do something a lot nicer: add an exponential-gamma brightness display.
This commit is contained in:
Kiana Sheibani 2026-01-25 04:45:00 -05:00
parent bc5d256073
commit e45f412930
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
9 changed files with 28 additions and 133 deletions

View file

@ -11,7 +11,6 @@ Item {
id: root
required property var uiState
required property Brightness.Monitor monitor
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
@ -95,13 +94,10 @@ Item {
implicitHeight: Config.osd.sliderLength
function onWheel(event: WheelEvent) {
const monitor = root.monitor;
if (!monitor)
return;
if (event.angleDelta.y > 0)
monitor.setBrightness(monitor.brightness + 0.1);
Brightness.setBrightness(Brightness.brightness + 0.1);
else if (event.angleDelta.y < 0)
monitor.setBrightness(monitor.brightness - 0.1);
Brightness.setBrightness(Brightness.brightness - 0.1);
}
CustomFilledSlider {
@ -109,8 +105,8 @@ Item {
color: Config.colors.brightness
icon: Icons.getBrightnessIcon(value)
value: root.monitor?.brightness ?? 0
onMoved: root.monitor?.setBrightness(value)
value: Brightness.brightness
onMoved: Brightness.setBrightness(value)
}
}
}