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