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