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:
parent
bc5d256073
commit
e45f412930
9 changed files with 28 additions and 133 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue