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": {
|
||||
"audioIncrement": 0.1,
|
||||
"brightnessIncrement": 0.1,
|
||||
"maxVolume": 1.0,
|
||||
"defaultPlayer": "Spotify",
|
||||
"gpuType": "",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ JsonObject {
|
|||
property string gpuType: ""
|
||||
property int visualiserBars: 45
|
||||
property real audioIncrement: 0.1
|
||||
property real brightnessIncrement: 0.1
|
||||
property real maxVolume: 1.0
|
||||
property bool smartScheme: true
|
||||
property string defaultPlayer: "Spotify"
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ ColumnLayout {
|
|||
// Brightness scroll on bottom half
|
||||
const monitor = Brightness.getMonitorForScreen(screen);
|
||||
if (angleDelta.y > 0)
|
||||
monitor.setBrightness(monitor.brightness + 0.1);
|
||||
monitor.setBrightness(monitor.brightness + Config.services.brightnessIncrement);
|
||||
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 ComponentBehavior: Bound
|
||||
|
||||
import qs.config
|
||||
import qs.components.misc
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
|
@ -43,13 +44,13 @@ Singleton {
|
|||
function increaseBrightness(): void {
|
||||
const monitor = getMonitor("active");
|
||||
if (monitor)
|
||||
monitor.setBrightness(monitor.brightness + 0.1);
|
||||
monitor.setBrightness(monitor.brightness + Config.services.brightnessIncrement);
|
||||
}
|
||||
|
||||
function decreaseBrightness(): void {
|
||||
const monitor = getMonitor("active");
|
||||
if (monitor)
|
||||
monitor.setBrightness(monitor.brightness - 0.1);
|
||||
monitor.setBrightness(monitor.brightness - Config.services.brightnessIncrement);
|
||||
}
|
||||
|
||||
onMonitorsChanged: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue