forked from Shinonome/dots-hyprland
make 25 lowest possible gamma
This commit is contained in:
@@ -11,6 +11,8 @@ Item {
|
||||
required property string name
|
||||
property bool rotateIcon: false
|
||||
property bool scaleIcon: false
|
||||
property alias from: valueProgressBar.from
|
||||
property alias to: valueProgressBar.to
|
||||
|
||||
property real valueIndicatorVerticalPadding: 9
|
||||
property real valueIndicatorLeftPadding: 10
|
||||
|
||||
@@ -9,5 +9,6 @@ OsdValueIndicator {
|
||||
|
||||
icon: "wb_twilight"
|
||||
name: Translation.tr("Gamma")
|
||||
from: Hyprsunset.gammaLowerLimit / 100
|
||||
value: Hyprsunset.gamma / 100 ?? 0.5
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ Rectangle {
|
||||
sourceComponent: QuickSlider {
|
||||
materialSymbol: "light_mode"
|
||||
secondaryMaterialSymbol: "wb_twilight"
|
||||
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
|
||||
tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor.brightness * 100)}%` : `${Hyprsunset.gamma}%`
|
||||
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
|
||||
tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor?.brightness * 100)}%` : `${Translation.tr("Gamma")} ${Hyprsunset.gamma}%`
|
||||
onMoved: {
|
||||
if (value >= 0.3) {
|
||||
// 0.3 - 1.0 brightness
|
||||
|
||||
@@ -182,8 +182,10 @@ WindowDialog {
|
||||
leftMargin: 4
|
||||
rightMargin: 4
|
||||
}
|
||||
from: Hyprsunset.gammaLowerLimit / 100
|
||||
value: Hyprsunset.gamma / 100
|
||||
onMoved: Hyprsunset.setGamma(value * 100)
|
||||
tooltipContent: `${Math.round(value * 100)}%`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ Singleton {
|
||||
id: root
|
||||
signal gammaChangeAttempt()
|
||||
|
||||
readonly property real gammaLowerLimit: 25
|
||||
|
||||
property string from: Config.options?.light?.night?.from ?? "19:00"
|
||||
property string to: Config.options?.light?.night?.to ?? "06:30"
|
||||
property bool automatic: Config.options?.light?.night?.automatic && (Config?.ready ?? true)
|
||||
@@ -114,7 +116,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function setGamma(gamma) {
|
||||
root.gamma = Math.max(0, Math.min(100, gamma));
|
||||
root.gamma = Math.max(root.gammaLowerLimit, Math.min(100, gamma));
|
||||
|
||||
root.gammaChangeAttempt();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user