config: allow enable/disable osd brightness (#481)
* Added option to disable brightness slider * Removed unwanted imports * Renamed WrappedLoader.name to brightnessSlider * fixes --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
This commit is contained in:
parent
1a9c6785a1
commit
cdfc260f39
3 changed files with 32 additions and 17 deletions
|
|
@ -324,6 +324,8 @@ default, you must create it manually.
|
||||||
"expire": false
|
"expire": false
|
||||||
},
|
},
|
||||||
"osd": {
|
"osd": {
|
||||||
|
"enabled": true,
|
||||||
|
"enableBrightness": true,
|
||||||
"hideDelay": 2000
|
"hideDelay": 2000
|
||||||
},
|
},
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import Quickshell.Io
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
property int hideDelay: 2000
|
property int hideDelay: 2000
|
||||||
|
property bool enableBrightness: true
|
||||||
property Sizes sizes: Sizes {}
|
property Sizes sizes: Sizes {}
|
||||||
|
|
||||||
component Sizes: JsonObject {
|
component Sizes: JsonObject {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.components.controls
|
import qs.components.controls
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.config
|
import qs.config
|
||||||
|
|
@ -16,6 +18,7 @@ Column {
|
||||||
|
|
||||||
spacing: Appearance.spacing.normal
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
// Speaker volume
|
||||||
CustomMouseArea {
|
CustomMouseArea {
|
||||||
implicitWidth: Config.osd.sizes.sliderWidth
|
implicitWidth: Config.osd.sizes.sliderWidth
|
||||||
implicitHeight: Config.osd.sizes.sliderHeight
|
implicitHeight: Config.osd.sizes.sliderHeight
|
||||||
|
|
@ -36,7 +39,11 @@ Column {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMouseArea {
|
// Brightness
|
||||||
|
WrappedLoader {
|
||||||
|
active: Config.osd.enableBrightness
|
||||||
|
|
||||||
|
sourceComponent: CustomMouseArea {
|
||||||
implicitWidth: Config.osd.sizes.sliderWidth
|
implicitWidth: Config.osd.sizes.sliderWidth
|
||||||
implicitHeight: Config.osd.sizes.sliderHeight
|
implicitHeight: Config.osd.sizes.sliderHeight
|
||||||
|
|
||||||
|
|
@ -59,3 +66,8 @@ Column {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
component WrappedLoader: Loader {
|
||||||
|
asynchronous: true
|
||||||
|
visible: active
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue