feat: initial commit for pixel-snapping components and helpers
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell
|
||||
import ZShell.Components
|
||||
import ZShell.Services
|
||||
import ZShell.Config
|
||||
import qs.Components
|
||||
import qs.Modules.Resources.Cards
|
||||
import qs.Helpers
|
||||
import qs.Services
|
||||
@@ -11,25 +14,25 @@ Item {
|
||||
|
||||
required property Wrapper wrapper
|
||||
|
||||
implicitHeight: content.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: content.implicitWidth
|
||||
implicitHeight: ZUtils.snap(content.implicitHeight + Tokens.padding.small * 2, root)
|
||||
implicitWidth: ZUtils.snap(content.implicitWidth, root)
|
||||
|
||||
RowLayout {
|
||||
SnapLayout {
|
||||
id: content
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
ColumnLayout {
|
||||
SnapLayout {
|
||||
id: mainColumn
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.medium
|
||||
orientation: Qt.Vertical
|
||||
|
||||
RowLayout {
|
||||
SnapLayout {
|
||||
id: hero
|
||||
spacing: Tokens.spacing.medium
|
||||
visible: cpuCard.active || gpuCard.active
|
||||
|
||||
@@ -72,7 +75,10 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SnapLayout {
|
||||
id: card
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.medium
|
||||
visible: storageCard.active || memoryCard.active || vramCard.active || networkCard1.active
|
||||
|
||||
@@ -81,8 +87,7 @@ Item {
|
||||
|
||||
active: Config.dashboard.performance.showStorage
|
||||
|
||||
sourceComponent: StorageCard {
|
||||
}
|
||||
sourceComponent: StorageCard {}
|
||||
}
|
||||
|
||||
WrappedLoader {
|
||||
@@ -91,6 +96,15 @@ Item {
|
||||
active: Config.dashboard.performance.showMemory
|
||||
|
||||
sourceComponent: MemoryCard {
|
||||
used: Memory.used
|
||||
total: Memory.total
|
||||
perc: Memory.percentage
|
||||
label: qsTr("Memory")
|
||||
icon: "memory_alt"
|
||||
|
||||
ServiceRef {
|
||||
service: Memory
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +113,12 @@ Item {
|
||||
|
||||
active: Config.dashboard.performance.showVram
|
||||
|
||||
sourceComponent: VramCard {
|
||||
sourceComponent: MemoryCard {
|
||||
used: Gpu.memoryUsed
|
||||
total: Gpu.memoryTotal
|
||||
perc: Gpu.memoryUsed / Gpu.memoryTotal
|
||||
label: qsTr("Video memory")
|
||||
icon: "memory_alt"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,8 +127,7 @@ Item {
|
||||
|
||||
active: Config.dashboard.performance.showNetwork && !vramCard.active
|
||||
|
||||
sourceComponent: NetworkCard {
|
||||
}
|
||||
sourceComponent: NetworkCard {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +136,7 @@ Item {
|
||||
|
||||
active: Config.dashboard.performance.showNetwork && vramCard.active
|
||||
|
||||
sourceComponent: NetworkCard {
|
||||
}
|
||||
sourceComponent: NetworkCard {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,8 +144,7 @@ Item {
|
||||
Layout.fillWidth: false
|
||||
active: Battery.isLaptop && Config.dashboard.performance.showBattery
|
||||
|
||||
sourceComponent: BatteryTank {
|
||||
}
|
||||
sourceComponent: BatteryTank {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user