config moved to c++ plugin, removed old qml + fileview implementation

This commit is contained in:
2026-08-13 02:25:26 +02:00
parent c29b91cd26
commit 3cd3209b28
341 changed files with 4851 additions and 3502 deletions
+53 -56
View File
@@ -6,34 +6,33 @@ import Quickshell.Widgets
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import qs.Config
import ZShell.Config
import qs.Components
import qs.Daemons
import qs.Helpers
import qs.Services
Item {
id: root
readonly property int rounding: Appearance.rounding.small - Appearance.padding.small
readonly property int rounding: Tokens.rounding.small - Tokens.padding.small
readonly property int topMargin: 0
required property var wrapper
implicitHeight: vol.implicitHeight + Appearance.padding.small * 2
implicitWidth: 500 + Appearance.padding.small * 2
implicitHeight: vol.implicitHeight + Tokens.padding.small * 2
implicitWidth: 500 + Tokens.padding.small * 2
CustomRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
color: DynamicColors.tPalette.m3surfaceContainer
color: Colors.tPalette.m3surfaceContainer
implicitHeight: parent.implicitHeight
radius: Appearance.rounding.small
radius: Tokens.rounding.small
y: parent.y
Behavior on implicitHeight {
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
}
}
@@ -42,7 +41,7 @@ Item {
id: vol
anchors.left: parent.left
anchors.margins: Appearance.padding.small
anchors.margins: Tokens.padding.small
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
@@ -52,17 +51,17 @@ Item {
CustomRect {
Layout.fillWidth: true
Layout.preferredHeight: 65 + Appearance.spacing.smaller * 2
Layout.preferredHeight: 65 + Tokens.spacing.smaller * 2
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3surfaceContainer
color: Colors.tPalette.m3surfaceContainer
radius: root.rounding
ColumnLayout {
anchors.bottomMargin: Appearance.padding.smaller
anchors.bottomMargin: Tokens.padding.smaller
anchors.fill: parent
anchors.leftMargin: Appearance.padding.larger
anchors.rightMargin: Appearance.padding.larger
anchors.topMargin: Appearance.padding.smaller
anchors.leftMargin: Tokens.padding.larger
anchors.rightMargin: Tokens.padding.larger
anchors.topMargin: Tokens.padding.smaller
RowLayout {
Layout.fillHeight: true
@@ -76,27 +75,27 @@ Item {
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: Qt.alpha(DynamicColors.palette.m3onSurface, 0.7)
color: Qt.alpha(Colors.palette.m3onSurface, 0.7)
font.bold: true
text: qsTr("%1").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
}
}
RowLayout {
spacing: Appearance.spacing.large
spacing: Tokens.spacing.large
CustomMouseArea {
Layout.bottomMargin: Appearance.padding.normal
Layout.bottomMargin: Tokens.padding.normal
Layout.fillWidth: true
Layout.preferredHeight: Appearance.padding.larger * 3
Layout.preferredHeight: Tokens.padding.larger * 3
CustomSlider {
anchors.left: parent.left
anchors.right: parent.right
bgColor: Audio.muted ? Qt.alpha(DynamicColors.palette.m3errorContainer, 0.5) : DynamicColors.palette.m3secondaryContainer
fgColor: Audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
bgColor: Audio.muted ? Qt.alpha(Colors.palette.m3errorContainer, 0.5) : Colors.palette.m3secondaryContainer
fgColor: Audio.muted ? Colors.palette.m3error : Colors.palette.m3primary
implicitHeight: parent.height
insetColor: Audio.muted ? (inset.attached ? DynamicColors.palette.m3onErrorContainer : DynamicColors.palette.m3onError) : (inset.attached ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onPrimary)
insetColor: Audio.muted ? (inset.attached ? Colors.palette.m3onErrorContainer : Colors.palette.m3onError) : (inset.attached ? Colors.palette.m3onSecondaryContainer : Colors.palette.m3onPrimary)
insetIcon: Audio.muted || Audio.volume < 0.001 ? "volume_off" : "volume_up"
value: Audio.volume
@@ -110,7 +109,7 @@ Item {
}
CustomSwitch {
Layout.bottomMargin: Appearance.padding.normal
Layout.bottomMargin: Tokens.padding.normal
checked: !Audio.muted
onToggled: {
@@ -125,9 +124,9 @@ Item {
CustomClippingRect {
Layout.fillWidth: true
Layout.preferredHeight: 65 + Appearance.spacing.smaller * 2
Layout.preferredHeight: 65 + Tokens.spacing.smaller * 2
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3surfaceContainer
color: Colors.tPalette.m3surfaceContainer
radius: root.rounding
PwNodePeakMonitor {
@@ -142,22 +141,21 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(DynamicColors.palette.m3primary, 0.15)
color: Qt.alpha(Colors.palette.m3primary, 0.15)
implicitWidth: parent.width * sourcePeak.peak
Behavior on implicitWidth {
Anim {
duration: MaterialEasing.expressiveEffectsTime
}
}
}
ColumnLayout {
anchors.bottomMargin: Appearance.padding.smaller
anchors.bottomMargin: Tokens.padding.smaller
anchors.fill: parent
anchors.leftMargin: Appearance.padding.larger
anchors.rightMargin: Appearance.padding.larger
anchors.topMargin: Appearance.padding.smaller
anchors.leftMargin: Tokens.padding.larger
anchors.rightMargin: Tokens.padding.larger
anchors.topMargin: Tokens.padding.smaller
RowLayout {
Layout.fillHeight: true
@@ -171,27 +169,27 @@ Item {
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: Qt.alpha(DynamicColors.palette.m3onSurface, 0.7)
color: Qt.alpha(Colors.palette.m3onSurface, 0.7)
font.bold: true
text: qsTr("%1").arg(Audio.sourceMuted ? qsTr("Muted") : `${Math.round(Audio.sourceVolume * 100)}%`)
}
}
RowLayout {
spacing: Appearance.spacing.large
spacing: Tokens.spacing.large
CustomMouseArea {
Layout.bottomMargin: Appearance.padding.normal
Layout.bottomMargin: Tokens.padding.normal
Layout.fillWidth: true
Layout.preferredHeight: Appearance.padding.larger * 3
Layout.preferredHeight: Tokens.padding.larger * 3
CustomSlider {
anchors.left: parent.left
anchors.right: parent.right
bgColor: Audio.sourceMuted ? Qt.alpha(DynamicColors.palette.m3errorContainer, 0.5) : DynamicColors.palette.m3secondaryContainer
fgColor: Audio.sourceMuted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
bgColor: Audio.sourceMuted ? Qt.alpha(Colors.palette.m3errorContainer, 0.5) : Colors.palette.m3secondaryContainer
fgColor: Audio.sourceMuted ? Colors.palette.m3error : Colors.palette.m3primary
implicitHeight: parent.height
insetColor: Audio.sourceMuted ? (inset.attached ? DynamicColors.palette.m3onErrorContainer : DynamicColors.palette.m3onError) : (inset.attached ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onPrimary)
insetColor: Audio.sourceMuted ? (inset.attached ? Colors.palette.m3onErrorContainer : Colors.palette.m3onError) : (inset.attached ? Colors.palette.m3onSecondaryContainer : Colors.palette.m3onPrimary)
insetIcon: Audio.sourceMuted || Audio.sourceVolume < 0.001 ? "mic_off" : "mic"
value: Audio.sourceVolume
@@ -205,7 +203,7 @@ Item {
}
CustomSwitch {
Layout.bottomMargin: Appearance.padding.normal
Layout.bottomMargin: Tokens.padding.normal
checked: !Audio.sourceMuted
onToggled: {
@@ -222,7 +220,7 @@ Item {
Layout.fillWidth: true
Layout.preferredHeight: 1
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3outline
color: Colors.tPalette.m3outline
visible: appTracks.model.length > 0
}
@@ -238,9 +236,9 @@ Item {
required property var modelData
Layout.fillWidth: true
Layout.preferredHeight: 65 + Appearance.spacing.smaller * 2
Layout.preferredHeight: 65 + Tokens.spacing.smaller * 2
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3surfaceContainer
color: Colors.tPalette.m3surfaceContainer
radius: root.rounding
PwNodePeakMonitor {
@@ -255,12 +253,11 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(DynamicColors.palette.m3primary, 0.15)
color: Qt.alpha(Colors.palette.m3primary, 0.15)
implicitWidth: parent.width * peak.peak
Behavior on implicitWidth {
Anim {
duration: MaterialEasing.expressiveEffectsTime
}
}
}
@@ -274,11 +271,11 @@ Item {
}
ColumnLayout {
anchors.bottomMargin: Appearance.padding.smaller
anchors.bottomMargin: Tokens.padding.smaller
anchors.fill: parent
anchors.leftMargin: Appearance.padding.larger
anchors.rightMargin: Appearance.padding.larger
anchors.topMargin: Appearance.padding.smaller
anchors.leftMargin: Tokens.padding.larger
anchors.rightMargin: Tokens.padding.larger
anchors.topMargin: Tokens.padding.smaller
RowLayout {
Layout.fillHeight: true
@@ -293,27 +290,27 @@ Item {
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: Qt.alpha(DynamicColors.palette.m3onSurface, 0.7)
color: Qt.alpha(Colors.palette.m3onSurface, 0.7)
font.bold: true
text: qsTr("%1").arg(appBox.modelData.audio.muted ? qsTr("Muted") : `${Math.round(appBox.modelData.audio.volume * 100)}%`)
}
}
RowLayout {
spacing: Appearance.spacing.large
spacing: Tokens.spacing.large
CustomMouseArea {
Layout.bottomMargin: Appearance.padding.normal
Layout.bottomMargin: Tokens.padding.normal
Layout.fillWidth: true
Layout.preferredHeight: Appearance.padding.larger * 3
Layout.preferredHeight: Tokens.padding.larger * 3
CustomSlider {
anchors.left: parent.left
anchors.right: parent.right
bgColor: appBox.modelData.audio.muted ? Qt.alpha(DynamicColors.palette.m3errorContainer, 0.5) : DynamicColors.palette.m3secondaryContainer
fgColor: appBox.modelData.audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
bgColor: appBox.modelData.audio.muted ? Qt.alpha(Colors.palette.m3errorContainer, 0.5) : Colors.palette.m3secondaryContainer
fgColor: appBox.modelData.audio.muted ? Colors.palette.m3error : Colors.palette.m3primary
implicitHeight: parent.height
insetColor: appBox.modelData.audio.muted ? (inset.attached ? DynamicColors.palette.m3onErrorContainer : DynamicColors.palette.m3onError) : (inset.attached ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onPrimary)
insetColor: appBox.modelData.audio.muted ? (inset.attached ? Colors.palette.m3onErrorContainer : Colors.palette.m3onError) : (inset.attached ? Colors.palette.m3onSecondaryContainer : Colors.palette.m3onPrimary)
insetIcon: appBox.modelData.audio.muted || appBox.modelData.audio.volume < 0.001 ? "volume_off" : "volume_up"
value: appBox.modelData.audio.volume
@@ -327,7 +324,7 @@ Item {
}
CustomSwitch {
Layout.bottomMargin: Appearance.padding.normal
Layout.bottomMargin: Tokens.padding.normal
checked: !appBox.modelData.audio.muted
onToggled: {