internal: use layouts for dashboard
This commit is contained in:
parent
1518b37b9b
commit
5c4de3016b
2 changed files with 25 additions and 8 deletions
|
|
@ -4,6 +4,7 @@ import "root:/config"
|
|||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
@ -78,20 +79,24 @@ Item {
|
|||
contentX = Qt.binding(() => currentItem.x);
|
||||
}
|
||||
|
||||
Row {
|
||||
RowLayout {
|
||||
id: row
|
||||
|
||||
Dash {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
shouldUpdate: visible && this === view.currentItem
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
|
||||
Media {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
shouldUpdate: visible && this === view.currentItem
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
|
||||
Performance {}
|
||||
Performance {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on contentX {
|
||||
|
|
|
|||
|
|
@ -2,16 +2,21 @@ import "root:/widgets"
|
|||
import "root:/services"
|
||||
import "root:/config"
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
Row {
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
readonly property int padding: Appearance.padding.large
|
||||
|
||||
spacing: Appearance.spacing.large * 3
|
||||
padding: Appearance.padding.large
|
||||
leftPadding: padding * 2
|
||||
rightPadding: padding * 3
|
||||
|
||||
Resource {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.topMargin: root.padding
|
||||
Layout.bottomMargin: root.padding
|
||||
Layout.leftMargin: root.padding * 2
|
||||
|
||||
value1: Math.min(1, SystemUsage.gpuTemp / 90)
|
||||
value2: SystemUsage.gpuPerc
|
||||
|
||||
|
|
@ -23,6 +28,10 @@ Row {
|
|||
}
|
||||
|
||||
Resource {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.topMargin: root.padding
|
||||
Layout.bottomMargin: root.padding
|
||||
|
||||
primary: true
|
||||
|
||||
value1: Math.min(1, SystemUsage.cpuTemp / 90)
|
||||
|
|
@ -36,6 +45,11 @@ Row {
|
|||
}
|
||||
|
||||
Resource {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.topMargin: root.padding
|
||||
Layout.bottomMargin: root.padding
|
||||
Layout.rightMargin: root.padding * 3
|
||||
|
||||
value1: SystemUsage.memPerc
|
||||
value2: SystemUsage.storagePerc
|
||||
|
||||
|
|
@ -72,8 +86,6 @@ Row {
|
|||
property color bg1: Colours.palette.m3primaryContainer
|
||||
property color bg2: Colours.palette.m3secondaryContainer
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
implicitWidth: Config.dashboard.sizes.resourceSize * primaryMult
|
||||
implicitHeight: Config.dashboard.sizes.resourceSize * primaryMult
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue