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
+25 -24
View File
@@ -1,17 +1,18 @@
import QtQuick
import QtQuick.Layouts
import ZShell.Internal
import ZShell.Config
import qs.Helpers
import qs.Components
import qs.Config
import qs.Services
CustomRect {
id: root
color: DynamicColors.tPalette.m3surfaceContainer
color: Colors.tPalette.m3surfaceContainer
implicitHeight: 220
implicitWidth: 300
radius: Appearance.rounding.large - Appearance.padding.normal
radius: Tokens.rounding.large - Tokens.padding.normal
Ref {
service: NetworkUsage
@@ -20,16 +21,16 @@ CustomRect {
ColumnLayout {
id: layout
anchors.bottomMargin: Appearance.padding.larger
anchors.bottomMargin: Tokens.padding.larger
anchors.fill: parent
anchors.margins: Appearance.padding.large
anchors.margins: Tokens.padding.large
spacing: 0
RowLayout {
spacing: Appearance.spacing.small
spacing: Tokens.spacing.small
MaterialIcon {
color: DynamicColors.palette.m3primary
color: Colors.palette.m3primary
text: "swap_vert"
}
@@ -39,10 +40,10 @@ CustomRect {
}
Item {
Layout.bottomMargin: Appearance.spacing.small
Layout.bottomMargin: Tokens.spacing.small
Layout.fillHeight: true
Layout.fillWidth: true
Layout.topMargin: Appearance.spacing.larger
Layout.topMargin: Tokens.spacing.larger
SparklineItem {
id: sparkline
@@ -54,10 +55,10 @@ CustomRect {
anchors.fill: parent
historyLength: NetworkUsage.historyLength
line1: NetworkUsage.uploadBuffer // qmllint disable missing-type
line1Color: DynamicColors.palette.m3secondary
line1Color: Colors.palette.m3secondary
line1FillAlpha: 0.15
line2: NetworkUsage.downloadBuffer // qmllint disable missing-type
line2Color: DynamicColors.palette.m3tertiary
line2Color: Colors.palette.m3tertiary
line2FillAlpha: 0.2
maxValue: smoothMax
slideProgress: 1
@@ -101,7 +102,7 @@ CustomRect {
// "Collecting data" placeholder
CustomText {
anchors.centerIn: parent
color: DynamicColors.palette.m3outline
color: Colors.palette.m3outline
text: qsTr("Collecting data...")
visible: NetworkUsage.downloadBuffer.count < 2
}
@@ -110,15 +111,15 @@ CustomRect {
// Download row
RowLayout {
Layout.fillWidth: true
spacing: Appearance.spacing.small
spacing: Tokens.spacing.small
MaterialIcon {
color: DynamicColors.palette.m3tertiary
color: Colors.palette.m3tertiary
text: "download"
}
CustomText {
color: DynamicColors.palette.m3onSurfaceVariant
color: Colors.palette.m3onSurfaceVariant
text: qsTr("Download")
}
@@ -127,7 +128,7 @@ CustomRect {
}
CustomText {
color: DynamicColors.palette.m3tertiary
color: Colors.palette.m3tertiary
text: {
const fmt = NetworkUsage.formatBytes(NetworkUsage.downloadSpeed ?? 0);
return fmt ? `${fmt.value.toFixed(1)} ${fmt.unit}` : "0.0 B/s";
@@ -138,15 +139,15 @@ CustomRect {
// Upload row
RowLayout {
Layout.fillWidth: true
spacing: Appearance.spacing.small
spacing: Tokens.spacing.small
MaterialIcon {
color: DynamicColors.palette.m3secondary
color: Colors.palette.m3secondary
text: "upload"
}
CustomText {
color: DynamicColors.palette.m3onSurfaceVariant
color: Colors.palette.m3onSurfaceVariant
text: qsTr("Upload")
}
@@ -155,7 +156,7 @@ CustomRect {
}
CustomText {
color: DynamicColors.palette.m3secondary
color: Colors.palette.m3secondary
text: {
const fmt = NetworkUsage.formatBytes(NetworkUsage.uploadSpeed ?? 0);
return fmt ? `${fmt.value.toFixed(1)} ${fmt.unit}` : "0.0 B/s";
@@ -166,15 +167,15 @@ CustomRect {
// Session totals
RowLayout {
Layout.fillWidth: true
spacing: Appearance.spacing.small
spacing: Tokens.spacing.small
MaterialIcon {
color: DynamicColors.palette.m3onSurfaceVariant
color: Colors.palette.m3onSurfaceVariant
text: "history"
}
CustomText {
color: DynamicColors.palette.m3onSurfaceVariant
color: Colors.palette.m3onSurfaceVariant
text: qsTr("Total")
}
@@ -183,7 +184,7 @@ CustomRect {
}
CustomText {
color: DynamicColors.palette.m3onSurfaceVariant
color: Colors.palette.m3onSurfaceVariant
text: {
const down = NetworkUsage.formatBytesTotal(NetworkUsage.downloadTotal ?? 0);
const up = NetworkUsage.formatBytesTotal(NetworkUsage.uploadTotal ?? 0);