services: add brightnessIncrement config property (#1010)
* feat: Add brightnessIncrement config property * birghtness increment applies on bar scroll
This commit is contained in:
parent
04bfc87f65
commit
49b94e7b18
4 changed files with 7 additions and 4 deletions
|
|
@ -563,6 +563,7 @@ default, you must create it manually.
|
||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
"audioIncrement": 0.1,
|
"audioIncrement": 0.1,
|
||||||
|
"brightnessIncrement": 0.1,
|
||||||
"maxVolume": 1.0,
|
"maxVolume": 1.0,
|
||||||
"defaultPlayer": "Spotify",
|
"defaultPlayer": "Spotify",
|
||||||
"gpuType": "",
|
"gpuType": "",
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ JsonObject {
|
||||||
property string gpuType: ""
|
property string gpuType: ""
|
||||||
property int visualiserBars: 45
|
property int visualiserBars: 45
|
||||||
property real audioIncrement: 0.1
|
property real audioIncrement: 0.1
|
||||||
|
property real brightnessIncrement: 0.1
|
||||||
property real maxVolume: 1.0
|
property real maxVolume: 1.0
|
||||||
property bool smartScheme: true
|
property bool smartScheme: true
|
||||||
property string defaultPlayer: "Spotify"
|
property string defaultPlayer: "Spotify"
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,9 @@ ColumnLayout {
|
||||||
// Brightness scroll on bottom half
|
// Brightness scroll on bottom half
|
||||||
const monitor = Brightness.getMonitorForScreen(screen);
|
const monitor = Brightness.getMonitorForScreen(screen);
|
||||||
if (angleDelta.y > 0)
|
if (angleDelta.y > 0)
|
||||||
monitor.setBrightness(monitor.brightness + 0.1);
|
monitor.setBrightness(monitor.brightness + Config.services.brightnessIncrement);
|
||||||
else if (angleDelta.y < 0)
|
else if (angleDelta.y < 0)
|
||||||
monitor.setBrightness(monitor.brightness - 0.1);
|
monitor.setBrightness(monitor.brightness - Config.services.brightnessIncrement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import qs.config
|
||||||
import qs.components.misc
|
import qs.components.misc
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
|
@ -43,13 +44,13 @@ Singleton {
|
||||||
function increaseBrightness(): void {
|
function increaseBrightness(): void {
|
||||||
const monitor = getMonitor("active");
|
const monitor = getMonitor("active");
|
||||||
if (monitor)
|
if (monitor)
|
||||||
monitor.setBrightness(monitor.brightness + 0.1);
|
monitor.setBrightness(monitor.brightness + Config.services.brightnessIncrement);
|
||||||
}
|
}
|
||||||
|
|
||||||
function decreaseBrightness(): void {
|
function decreaseBrightness(): void {
|
||||||
const monitor = getMonitor("active");
|
const monitor = getMonitor("active");
|
||||||
if (monitor)
|
if (monitor)
|
||||||
monitor.setBrightness(monitor.brightness - 0.1);
|
monitor.setBrightness(monitor.brightness - Config.services.brightnessIncrement);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMonitorsChanged: {
|
onMonitorsChanged: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue