forked from Shinonome/dots-hyprland
Make brightness quickslider follow gamma lower limit (#3139)
This commit is contained in:
@@ -43,7 +43,7 @@ Rectangle {
|
|||||||
materialSymbol: "light_mode"
|
materialSymbol: "light_mode"
|
||||||
secondaryMaterialSymbol: "wb_twilight"
|
secondaryMaterialSymbol: "wb_twilight"
|
||||||
stopIndicatorValues: Hyprsunset.gamma !== 100 && root.brightnessMonitor?.brightness !== 0 ? [0.3 + root.brightnessMonitor?.brightness * 0.7] : []
|
stopIndicatorValues: Hyprsunset.gamma !== 100 && root.brightnessMonitor?.brightness !== 0 ? [0.3 + root.brightnessMonitor?.brightness * 0.7] : []
|
||||||
value: Hyprsunset.gamma === 100? 0.3 + root.brightnessMonitor?.brightness * 0.7 : Hyprsunset.gamma / 100 * 0.3
|
value: Hyprsunset.gamma === 100? 0.3 + root.brightnessMonitor?.brightness * 0.7 : (Hyprsunset.gamma - Hyprsunset.gammaLowerLimit) / (100 - Hyprsunset.gammaLowerLimit) * 0.3
|
||||||
tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor?.brightness * 100)}%` : `${Translation.tr("Gamma")} ${Hyprsunset.gamma}%`
|
tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor?.brightness * 100)}%` : `${Translation.tr("Gamma")} ${Hyprsunset.gamma}%`
|
||||||
onMoved: {
|
onMoved: {
|
||||||
if (value >= 0.3) {
|
if (value >= 0.3) {
|
||||||
@@ -57,7 +57,7 @@ Rectangle {
|
|||||||
if (root.brightnessMonitor.brightness !== 0) {
|
if (root.brightnessMonitor.brightness !== 0) {
|
||||||
root.brightnessMonitor.setBrightness(0);
|
root.brightnessMonitor.setBrightness(0);
|
||||||
}
|
}
|
||||||
Hyprsunset.setGamma(value * 100 / 0.3);
|
Hyprsunset.setGamma((value / 0.3 * (100 - Hyprsunset.gammaLowerLimit) + Hyprsunset.gammaLowerLimit));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user