diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml index fc10c8a2a..e209ce286 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml @@ -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 diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml index f86a8d7c0..7fed00163 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml @@ -9,5 +9,6 @@ OsdValueIndicator { icon: "wb_twilight" name: Translation.tr("Gamma") + from: Hyprsunset.gammaLowerLimit / 100 value: Hyprsunset.gamma / 100 ?? 0.5 } diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml index d7e0a0b57..4e80f7203 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml @@ -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 diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml index 4f70983d9..7c7004b99 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml @@ -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)}%` } } diff --git a/dots/.config/quickshell/ii/services/Hyprsunset.qml b/dots/.config/quickshell/ii/services/Hyprsunset.qml index c9fac1a6d..d51d4fe99 100644 --- a/dots/.config/quickshell/ii/services/Hyprsunset.qml +++ b/dots/.config/quickshell/ii/services/Hyprsunset.qml @@ -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();