quickshell: meaningless refactor
This commit is contained in:
@@ -131,7 +131,6 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CavaBar {
|
CavaBar {
|
||||||
count: 6
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|||||||
@@ -2,27 +2,17 @@ import QtQuick
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Constants
|
import qs.Constants
|
||||||
import qs.Services
|
import qs.Modules.Bar.Misc
|
||||||
import qs.Utils
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int count: 6
|
|
||||||
property int barWidth: 5
|
property int barWidth: 5
|
||||||
property int barSpacing: 3
|
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
|
implicitHeight: parent.height - 10
|
||||||
|
|
||||||
Cava {
|
|
||||||
id: cavaProcess
|
|
||||||
|
|
||||||
count: root.count
|
|
||||||
forceEnable: root.forceEnable
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: root.barSpacing
|
spacing: root.barSpacing
|
||||||
@@ -32,7 +22,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: cavaProcess.values
|
model: CavaBarService.values
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: root.barWidth
|
width: root.barWidth
|
||||||
@@ -64,7 +54,7 @@ Item {
|
|||||||
else if (mouse.button === Qt.RightButton)
|
else if (mouse.button === Qt.RightButton)
|
||||||
SettingsService.showLyricsBar = !SettingsService.showLyricsBar;
|
SettingsService.showLyricsBar = !SettingsService.showLyricsBar;
|
||||||
else if (mouse.button === Qt.MiddleButton)
|
else if (mouse.button === Qt.MiddleButton)
|
||||||
root.forceEnable = !root.forceEnable;
|
CavaBarService.forceEnable = !CavaBarService.forceEnable;
|
||||||
}
|
}
|
||||||
onWheel: function(wheel) {
|
onWheel: function(wheel) {
|
||||||
if (wheel.angleDelta.y > 0)
|
if (wheel.angleDelta.y > 0)
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,9 @@
|
|||||||
"action": {
|
"action": {
|
||||||
"confirm": "change-wallpaper \"%1\" 2560 1600"
|
"confirm": "change-wallpaper \"%1\" 2560 1600"
|
||||||
},
|
},
|
||||||
|
"style": {
|
||||||
|
"no_loading_screen": false
|
||||||
|
},
|
||||||
"sort": {
|
"sort": {
|
||||||
"type": "date",
|
"type": "date",
|
||||||
"reverse": true
|
"reverse": true
|
||||||
|
|||||||
Reference in New Issue
Block a user