forked from Shinonome/dots-hyprland
Add gamma slider to night light dialog
This commit is contained in:
@@ -42,6 +42,7 @@ 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] : []
|
||||||
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)}%` : `${Hyprsunset.gamma}%`
|
||||||
onMoved: {
|
onMoved: {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ WindowDialog {
|
|||||||
id: root
|
id: root
|
||||||
property var screen: root.QsWindow.window?.screen
|
property var screen: root.QsWindow.window?.screen
|
||||||
property var brightnessMonitor: Brightness.getMonitorForScreen(screen)
|
property var brightnessMonitor: Brightness.getMonitorForScreen(screen)
|
||||||
backgroundHeight: 600
|
backgroundHeight: 700
|
||||||
|
|
||||||
WindowDialogTitle {
|
WindowDialogTitle {
|
||||||
text: Translation.tr("Eye protection")
|
text: Translation.tr("Eye protection")
|
||||||
@@ -146,6 +146,33 @@ WindowDialog {
|
|||||||
id: brightnessColumn
|
id: brightnessColumn
|
||||||
Layout.topMargin: -16
|
Layout.topMargin: -16
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
WindowDialogSlider {
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
leftMargin: 4
|
||||||
|
rightMargin: 4
|
||||||
|
}
|
||||||
|
value: root.brightnessMonitor.brightness
|
||||||
|
onMoved: root.brightnessMonitor.setBrightness(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WindowDialogSectionHeader {
|
||||||
|
text: Translation.tr("Gamma")
|
||||||
|
}
|
||||||
|
|
||||||
|
WindowDialogSeparator {
|
||||||
|
Layout.topMargin: -22
|
||||||
|
Layout.leftMargin: 0
|
||||||
|
Layout.rightMargin: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: gammaColumn
|
||||||
|
Layout.topMargin: -16
|
||||||
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
WindowDialogSlider {
|
WindowDialogSlider {
|
||||||
@@ -155,9 +182,8 @@ WindowDialog {
|
|||||||
leftMargin: 4
|
leftMargin: 4
|
||||||
rightMargin: 4
|
rightMargin: 4
|
||||||
}
|
}
|
||||||
// text: Translation.tr("Brightness")
|
value: Hyprsunset.gamma / 100
|
||||||
value: root.brightnessMonitor.brightness
|
onMoved: Hyprsunset.setGamma(value * 100)
|
||||||
onMoved: root.brightnessMonitor.setBrightness(value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user