mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
ii bar resources popup: use formatting func from ResourceUsage
This commit is contained in:
@@ -7,11 +7,6 @@ import QtQuick.Layouts
|
|||||||
StyledPopup {
|
StyledPopup {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
// Helper function to format KB to GB
|
|
||||||
function formatKB(kb) {
|
|
||||||
return (kb / (1024 * 1024)).toFixed(1) + " GB";
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 12
|
spacing: 12
|
||||||
@@ -29,17 +24,17 @@ StyledPopup {
|
|||||||
StyledPopupValueRow {
|
StyledPopupValueRow {
|
||||||
icon: "clock_loader_60"
|
icon: "clock_loader_60"
|
||||||
label: Translation.tr("Used:")
|
label: Translation.tr("Used:")
|
||||||
value: root.formatKB(ResourceUsage.memoryUsed)
|
value: ResourceUsage.kbToGbString(ResourceUsage.memoryUsed)
|
||||||
}
|
}
|
||||||
StyledPopupValueRow {
|
StyledPopupValueRow {
|
||||||
icon: "check_circle"
|
icon: "check_circle"
|
||||||
label: Translation.tr("Free:")
|
label: Translation.tr("Free:")
|
||||||
value: root.formatKB(ResourceUsage.memoryFree)
|
value: ResourceUsage.kbToGbString(ResourceUsage.memoryFree)
|
||||||
}
|
}
|
||||||
StyledPopupValueRow {
|
StyledPopupValueRow {
|
||||||
icon: "empty_dashboard"
|
icon: "empty_dashboard"
|
||||||
label: Translation.tr("Total:")
|
label: Translation.tr("Total:")
|
||||||
value: root.formatKB(ResourceUsage.memoryTotal)
|
value: ResourceUsage.kbToGbString(ResourceUsage.memoryTotal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,17 +53,17 @@ StyledPopup {
|
|||||||
StyledPopupValueRow {
|
StyledPopupValueRow {
|
||||||
icon: "clock_loader_60"
|
icon: "clock_loader_60"
|
||||||
label: Translation.tr("Used:")
|
label: Translation.tr("Used:")
|
||||||
value: root.formatKB(ResourceUsage.swapUsed)
|
value: ResourceUsage.kbToGbString(ResourceUsage.swapUsed)
|
||||||
}
|
}
|
||||||
StyledPopupValueRow {
|
StyledPopupValueRow {
|
||||||
icon: "check_circle"
|
icon: "check_circle"
|
||||||
label: Translation.tr("Free:")
|
label: Translation.tr("Free:")
|
||||||
value: root.formatKB(ResourceUsage.swapFree)
|
value: ResourceUsage.kbToGbString(ResourceUsage.swapFree)
|
||||||
}
|
}
|
||||||
StyledPopupValueRow {
|
StyledPopupValueRow {
|
||||||
icon: "empty_dashboard"
|
icon: "empty_dashboard"
|
||||||
label: Translation.tr("Total:")
|
label: Translation.tr("Total:")
|
||||||
value: root.formatKB(ResourceUsage.swapTotal)
|
value: ResourceUsage.kbToGbString(ResourceUsage.swapTotal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user