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
+29 -28
View File
@@ -2,16 +2,17 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell.Services.UPower
import qs.Config
import ZShell.Config
import qs.Helpers
import qs.Components
import qs.Services
Column {
id: root
readonly property int panelRadius: ((profiles.height / 2) + Appearance.padding.small) * Appearance.rounding.scale
readonly property int panelRadius: ((profiles.height / 2) + Tokens.padding.small) * Tokens.rounding.scale
spacing: Appearance.spacing.normal
spacing: Tokens.spacing.normal
Loader {
active: Battery.isLaptop
@@ -39,7 +40,7 @@ Column {
}
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.normal
anchors.leftMargin: Tokens.padding.normal
text: Battery.isLaptop ? qsTr("Time %1: %2").arg(Battery.onBattery ? "remaining" : "until charged").arg(Battery.onBattery ? formatSeconds(Battery.timeToEmpty, "Calculating...") : formatSeconds(Battery.timeToFull, "Fully charged!")) : qsTr("Power profile: %1").arg(PowerProfile.toString(PowerProfiles.profile))
}
@@ -50,10 +51,10 @@ Column {
height: active ? ((item as Item)?.implicitHeight ?? 0) : 0
sourceComponent: CustomRect {
color: DynamicColors.palette.m3error
implicitHeight: child.implicitHeight + Appearance.padding.large
implicitWidth: child.implicitWidth + Appearance.padding.larger * 2
radius: Appearance.rounding.large
color: Colors.palette.m3error
implicitHeight: child.implicitHeight + Tokens.padding.large
implicitWidth: child.implicitWidth + Tokens.padding.larger * 2
radius: Tokens.rounding.large
Column {
id: child
@@ -62,18 +63,18 @@ Column {
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: Appearance.spacing.small
spacing: Tokens.spacing.small
MaterialIcon {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -font.pointSize / 10
color: DynamicColors.palette.m3onError
color: Colors.palette.m3onError
text: "warning"
}
CustomText {
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.palette.m3onError
color: Colors.palette.m3onError
font.family: Appearance.font.family.mono
text: qsTr("Performance Degraded")
}
@@ -81,14 +82,14 @@ Column {
MaterialIcon {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -font.pointSize / 10
color: DynamicColors.palette.m3onError
color: Colors.palette.m3onError
text: "warning"
}
}
CustomText {
anchors.horizontalCenter: parent.horizontalCenter
color: DynamicColors.palette.m3onError
color: Colors.palette.m3onError
text: qsTr("Reason: %1").arg(PerformanceDegradationReason.toString(PowerProfiles.degradationReason))
}
}
@@ -108,16 +109,16 @@ Column {
}
anchors.horizontalCenter: parent.horizontalCenter
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: indicator.height + Appearance.padding.extraSmall * 2
implicitWidth: saver.implicitHeight + balance.implicitHeight + perf.implicitHeight + Appearance.padding.larger * 2 + Appearance.spacing.small * 8
radius: Appearance.rounding.full
color: Colors.tPalette.m3surfaceContainer
implicitHeight: indicator.height + Tokens.padding.extraSmall * 2
implicitWidth: saver.implicitHeight + balance.implicitHeight + perf.implicitHeight + Tokens.padding.larger * 2 + Tokens.spacing.small * 8
radius: Tokens.rounding.full
CustomRect {
id: indicator
color: DynamicColors.palette.m3primary
radius: Appearance.rounding.full
color: Colors.palette.m3primary
radius: Tokens.rounding.full
state: profiles.current
states: [
@@ -153,7 +154,7 @@ Column {
id: saver
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.extraSmall
anchors.leftMargin: Tokens.padding.extraSmall
anchors.verticalCenter: parent.verticalCenter
icon: "energy_savings_leaf"
profile: PowerProfile.PowerSaver
@@ -171,7 +172,7 @@ Column {
id: perf
anchors.right: parent.right
anchors.rightMargin: Appearance.padding.extraSmall
anchors.rightMargin: Tokens.padding.extraSmall
anchors.verticalCenter: parent.verticalCenter
icon: "bolt"
profile: PowerProfile.Performance
@@ -191,12 +192,12 @@ Column {
required property string icon
required property int profile
implicitHeight: icon.implicitHeight + Appearance.padding.small
implicitWidth: icon.implicitHeight + Appearance.padding.small
implicitHeight: icon.implicitHeight + Tokens.padding.small
implicitWidth: icon.implicitHeight + Tokens.padding.small
StateLayer {
color: profiles.current === parent.icon ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
radius: Appearance.rounding.full
color: profiles.current === parent.icon ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
radius: Tokens.rounding.full
onClicked: {
PowerProfiles.profile = parent.profile;
@@ -207,10 +208,10 @@ Column {
id: icon
anchors.centerIn: parent
color: profiles.current === text ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
color: profiles.current === text ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
fill: profiles.current === text ? 1 : 0
font.pointSize: Appearance.font.size.large * 2
grade: DynamicColors.light ? 0 : (text === "balance" ? -25 : 0)
font.pointSize: Tokens.font.size.large * 2
grade: Colors.light ? 0 : (text === "balance" ? -25 : 0)
text: parent.icon
Behavior on fill {