Files
z-bar-qt/Modules/Resources/Content.qml
T
AramJonghu da2ae635c0
C++ / fmt (pull_request) Successful in 13s
C++ / build & lint (pull_request) Canceled after 14s
JS/TS / fmt & lint (pull_request) Canceled after 7s
Python / fmt & lint (pull_request) Canceled after 12s
Python / test & nuitka build (pull_request) Canceled after 8s
Rust / clippy & fmt (pull_request) Canceled after 0s
chore(format): format files that were unformatted
2026-10-30 22:48:25 +01:00

135 lines
2.6 KiB
QML

import QtQuick
import QtQuick.Layouts
import ZShell.Services
import ZShell.Config
import qs.Modules.Resources.Cards
import qs.Helpers
import qs.Services
Item {
id: root
required property Wrapper wrapper
implicitHeight: content.implicitHeight + Tokens.padding.small * 2
implicitWidth: content.implicitWidth
RowLayout {
id: content
anchors.left: parent.left
anchors.margins: Tokens.padding.small
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: Tokens.spacing.large
ColumnLayout {
id: mainColumn
Layout.fillWidth: true
spacing: Tokens.spacing.medium
RowLayout {
spacing: Tokens.spacing.medium
visible: cpuCard.active || gpuCard.active
WrappedLoader {
id: cpuCard
active: Config.dashboard.performance.showCpu
sourceComponent: HeroCard {
accent: Colors.palette.m3primary
icon: "memory"
label: qsTr("CPU")
subLabel: Cpu.name
temperature: Cpu.temperature
usage: Cpu.percentage
ServiceRef {
service: Cpu
}
}
}
WrappedLoader {
id: gpuCard
active: Config.dashboard.performance.showGpu && Gpu.type !== Gpu.None
sourceComponent: HeroCard {
accent: Colors.palette.m3secondary
icon: "desktop_windows"
label: qsTr("GPU")
subLabel: Gpu.name
temperature: Gpu.temperature
usage: Gpu.percentage
ServiceRef {
service: Gpu
}
}
}
}
RowLayout {
spacing: Tokens.spacing.medium
visible: storageCard.active || memoryCard.active || vramCard.active || networkCard1.active
WrappedLoader {
id: storageCard
active: Config.dashboard.performance.showStorage
sourceComponent: StorageCard {}
}
WrappedLoader {
id: memoryCard
active: Config.dashboard.performance.showMemory
sourceComponent: MemoryCard {}
}
WrappedLoader {
id: vramCard
active: Config.dashboard.performance.showVram
sourceComponent: VramCard {}
}
WrappedLoader {
id: networkCard1
active: Config.dashboard.performance.showNetwork && !vramCard.active
sourceComponent: NetworkCard {}
}
}
WrappedLoader {
id: networkCard2
active: Config.dashboard.performance.showNetwork && vramCard.active
sourceComponent: NetworkCard {}
}
}
WrappedLoader {
Layout.fillWidth: false
active: Battery.isLaptop && Config.dashboard.performance.showBattery
sourceComponent: BatteryTank {}
}
}
component WrappedLoader: Loader {
Layout.fillHeight: true
Layout.fillWidth: true
visible: active
}
}