Files
z-bar-qt/Modules/Resources/Content.qml
T
zach 2a50732bc2
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 10s
Python / lint-format (pull_request) Successful in 23s
Python / test (pull_request) Successful in 31s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m12s
resources popout refresh + new components & reskinned old components
2026-06-14 23:09:10 +02:00

121 lines
2.3 KiB
QML

import QtQuick
import QtQuick.Layouts
import ZShell.Services
import qs.Modules.Resources.Cards
import qs.Helpers
import qs.Components
import qs.Config
Item {
id: root
implicitHeight: content.implicitHeight + Appearance.padding.normal * 2
implicitWidth: content.implicitWidth
RowLayout {
id: content
anchors.left: parent.left
anchors.margins: Appearance.padding.normal
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: Appearance.spacing.larger
ColumnLayout {
id: mainColumn
Layout.fillWidth: true
spacing: Appearance.spacing.larger
RowLayout {
spacing: Appearance.spacing.larger
visible: cpuCard.active || gpuCard.active
WrappedLoader {
id: cpuCard
active: Config.dashboard.performance.showCpu
sourceComponent: HeroCard {
accent: DynamicColors.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 && SystemUsage.gpuType !== ""
sourceComponent: HeroCard {
accent: DynamicColors.palette.m3secondary
icon: "desktop_windows"
label: qsTr("GPU")
subLabel: SystemUsage.gpuName
temperature: SystemUsage.gpuTemp
usage: SystemUsage.gpuPerc
Ref {
service: SystemUsage
}
}
}
}
RowLayout {
spacing: Appearance.spacing.larger
visible: storageCard.active || networkCard.active || memoryCard.active
WrappedLoader {
id: storageCard
active: Config.dashboard.performance.showStorage
sourceComponent: StorageCard {
}
}
WrappedLoader {
id: memoryCard
active: Config.dashboard.performance.showMemory
sourceComponent: MemoryCard {
}
}
WrappedLoader {
id: networkCard
active: Config.dashboard.performance.showNetwork
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
}
}