feat: loader dash perf cards + fix when some disabled
This commit is contained in:
parent
76b4a0b63c
commit
9543e761ec
2 changed files with 62 additions and 43 deletions
|
|
@ -55,14 +55,6 @@ Item {
|
||||||
spacing: Tokens.spacing.medium
|
spacing: Tokens.spacing.medium
|
||||||
visible: !placeholder.active
|
visible: !placeholder.active
|
||||||
|
|
||||||
ServiceRef {
|
|
||||||
service: root.Config.dashboard.performance.showCpu ? Cpu : null
|
|
||||||
}
|
|
||||||
|
|
||||||
ServiceRef {
|
|
||||||
service: root.Config.dashboard.performance.showGpu && Gpu.type !== Gpu.None ? Gpu : null
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainColumn
|
id: mainColumn
|
||||||
|
|
||||||
|
|
@ -70,59 +62,85 @@ Item {
|
||||||
spacing: Tokens.spacing.medium
|
spacing: Tokens.spacing.medium
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: Tokens.spacing.medium
|
spacing: Tokens.spacing.medium
|
||||||
visible: Config.dashboard.performance.showCpu || (Config.dashboard.performance.showGpu && Gpu.type !== Gpu.None)
|
visible: cpuCard.active || gpuCard.active
|
||||||
|
|
||||||
HeroCard {
|
WrappedLoader {
|
||||||
Layout.fillWidth: true
|
id: cpuCard
|
||||||
visible: Config.dashboard.performance.showCpu
|
|
||||||
|
active: Config.dashboard.performance.showCpu
|
||||||
|
|
||||||
|
sourceComponent: HeroCard {
|
||||||
icon: "memory"
|
icon: "memory"
|
||||||
label: qsTr("CPU")
|
label: qsTr("CPU")
|
||||||
subLabel: Cpu.name
|
subLabel: Cpu.name
|
||||||
usage: Cpu.percentage
|
usage: Cpu.percentage
|
||||||
temperature: Cpu.temperature
|
temperature: Cpu.temperature
|
||||||
accent: Colours.palette.m3primary
|
accent: Colours.palette.m3primary
|
||||||
|
|
||||||
|
ServiceRef {
|
||||||
|
service: Cpu
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HeroCard {
|
WrappedLoader {
|
||||||
Layout.fillWidth: true
|
id: gpuCard
|
||||||
visible: Config.dashboard.performance.showGpu && Gpu.type !== Gpu.None
|
|
||||||
|
active: Config.dashboard.performance.showGpu && Gpu.type !== Gpu.None
|
||||||
|
|
||||||
|
sourceComponent: HeroCard {
|
||||||
icon: "desktop_windows"
|
icon: "desktop_windows"
|
||||||
label: qsTr("GPU")
|
label: qsTr("GPU")
|
||||||
subLabel: Gpu.name
|
subLabel: Gpu.name
|
||||||
usage: Gpu.percentage
|
usage: Gpu.percentage
|
||||||
temperature: Gpu.temperature
|
temperature: Gpu.temperature
|
||||||
accent: Colours.palette.m3secondary
|
accent: Colours.palette.m3secondary
|
||||||
|
|
||||||
|
ServiceRef {
|
||||||
|
service: Gpu
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: Tokens.spacing.medium
|
spacing: Tokens.spacing.medium
|
||||||
visible: Config.dashboard.performance.showMemory || Config.dashboard.performance.showStorage || Config.dashboard.performance.showNetwork
|
visible: storageCard.active || networkCard.active || memoryCard.active
|
||||||
|
|
||||||
StorageCard {
|
WrappedLoader {
|
||||||
Layout.fillHeight: true
|
id: storageCard
|
||||||
visible: Config.dashboard.performance.showStorage
|
|
||||||
|
active: Config.dashboard.performance.showStorage
|
||||||
|
sourceComponent: StorageCard {}
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkCard {
|
WrappedLoader {
|
||||||
|
id: networkCard
|
||||||
|
|
||||||
|
active: Config.dashboard.performance.showNetwork
|
||||||
|
sourceComponent: NetworkCard {}
|
||||||
|
}
|
||||||
|
|
||||||
|
WrappedLoader {
|
||||||
|
id: memoryCard
|
||||||
|
|
||||||
|
active: Config.dashboard.performance.showMemory
|
||||||
|
sourceComponent: MemoryCard {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WrappedLoader {
|
||||||
|
Layout.fillWidth: false
|
||||||
|
active: UPower.displayDevice.isLaptopBattery && Config.dashboard.performance.showBattery
|
||||||
|
sourceComponent: BatteryTank {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component WrappedLoader: Loader {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
visible: Config.dashboard.performance.showNetwork
|
visible: active
|
||||||
}
|
|
||||||
|
|
||||||
MemoryCard {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
visible: Config.dashboard.performance.showMemory
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BatteryTank {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
visible: UPower.displayDevice.isLaptopBattery && Config.dashboard.performance.showBattery
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ StyledRect {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
spacing: Tokens.spacing.large
|
spacing: Tokens.spacing.large
|
||||||
|
|
||||||
CircularProgress {
|
CircularProgress {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue