forked from Shinonome/dots-hyprland
90 lines
2.6 KiB
QML
90 lines
2.6 KiB
QML
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs.services
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
StyledPopup {
|
|
id: root
|
|
|
|
Row {
|
|
anchors.centerIn: parent
|
|
spacing: 12
|
|
|
|
Column {
|
|
anchors.top: parent.top
|
|
spacing: 8
|
|
|
|
StyledPopupHeaderRow {
|
|
icon: "memory"
|
|
label: "RAM"
|
|
}
|
|
Column {
|
|
spacing: 4
|
|
StyledPopupValueRow {
|
|
icon: "clock_loader_60"
|
|
label: Translation.tr("Used:")
|
|
value: ResourceUsage.kbToGbString(ResourceUsage.memoryUsed)
|
|
}
|
|
StyledPopupValueRow {
|
|
icon: "check_circle"
|
|
label: Translation.tr("Free:")
|
|
value: ResourceUsage.kbToGbString(ResourceUsage.memoryFree)
|
|
}
|
|
StyledPopupValueRow {
|
|
icon: "empty_dashboard"
|
|
label: Translation.tr("Total:")
|
|
value: ResourceUsage.kbToGbString(ResourceUsage.memoryTotal)
|
|
}
|
|
}
|
|
}
|
|
|
|
Column {
|
|
visible: ResourceUsage.swapTotal > 0
|
|
anchors.top: parent.top
|
|
spacing: 8
|
|
|
|
StyledPopupHeaderRow {
|
|
icon: "swap_horiz"
|
|
label: "Swap"
|
|
}
|
|
Column {
|
|
spacing: 4
|
|
StyledPopupValueRow {
|
|
icon: "clock_loader_60"
|
|
label: Translation.tr("Used:")
|
|
value: ResourceUsage.kbToGbString(ResourceUsage.swapUsed)
|
|
}
|
|
StyledPopupValueRow {
|
|
icon: "check_circle"
|
|
label: Translation.tr("Free:")
|
|
value: ResourceUsage.kbToGbString(ResourceUsage.swapFree)
|
|
}
|
|
StyledPopupValueRow {
|
|
icon: "empty_dashboard"
|
|
label: Translation.tr("Total:")
|
|
value: ResourceUsage.kbToGbString(ResourceUsage.swapTotal)
|
|
}
|
|
}
|
|
}
|
|
|
|
Column {
|
|
anchors.top: parent.top
|
|
spacing: 8
|
|
|
|
StyledPopupHeaderRow {
|
|
icon: "planner_review"
|
|
label: "CPU"
|
|
}
|
|
Column {
|
|
spacing: 4
|
|
StyledPopupValueRow {
|
|
icon: "bolt"
|
|
label: Translation.tr("Load:")
|
|
value: `${Math.round(ResourceUsage.cpuUsage * 100)}%`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|