quickshell: meaningless refactor

This commit is contained in:
2025-12-01 14:17:49 +01:00
parent 8f9df4c730
commit bfda6f4ac2
4 changed files with 27 additions and 15 deletions

View File

@@ -131,7 +131,6 @@ Variants {
}
CavaBar {
count: 6
}
Item {

View File

@@ -2,27 +2,17 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qs.Constants
import qs.Services
import qs.Utils
import qs.Modules.Bar.Misc
Item {
id: root
property int count: 6
property int barWidth: 5
property int barSpacing: 3
property bool forceEnable: false
implicitWidth: root.barWidth * root.count + root.barSpacing * (root.count - 1)
implicitWidth: root.barWidth * CavaBarService.count + root.barSpacing * (CavaBarService.count - 1)
implicitHeight: parent.height - 10
Cava {
id: cavaProcess
count: root.count
forceEnable: root.forceEnable
}
RowLayout {
anchors.fill: parent
spacing: root.barSpacing
@@ -32,7 +22,7 @@ Item {
}
Repeater {
model: cavaProcess.values
model: CavaBarService.values
Rectangle {
width: root.barWidth
@@ -64,7 +54,7 @@ Item {
else if (mouse.button === Qt.RightButton)
SettingsService.showLyricsBar = !SettingsService.showLyricsBar;
else if (mouse.button === Qt.MiddleButton)
root.forceEnable = !root.forceEnable;
CavaBarService.forceEnable = !CavaBarService.forceEnable;
}
onWheel: function(wheel) {
if (wheel.angleDelta.y > 0)

View File

@@ -0,0 +1,20 @@
import QtQuick
import Quickshell
import qs.Utils
pragma Singleton
Singleton {
id: root
property int count: 6
property int forceEnable: 6
property alias values: cavaProcess.values
Cava {
id: cavaProcess
count: root.count
forceEnable: root.forceEnable
}
}

View File

@@ -6,6 +6,9 @@
"action": {
"confirm": "change-wallpaper \"%1\" 2560 1600"
},
"style": {
"no_loading_screen": false
},
"sort": {
"type": "date",
"reverse": true