forked from Shinonome/dots-hyprland
44 lines
1001 B
QML
44 lines
1001 B
QML
import qs
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs.services
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
|
|
Item {
|
|
id: root
|
|
required property string iconName
|
|
required property double percentage
|
|
implicitHeight: resourceProgress.implicitHeight
|
|
implicitWidth: Appearance.sizes.verticalBarWidth
|
|
|
|
// Helper function to format KB to GB
|
|
function formatKB(kb) {
|
|
return (kb / (1024 * 1024)).toFixed(1) + " GB";
|
|
}
|
|
|
|
ClippedFilledCircularProgress {
|
|
id: resourceProgress
|
|
anchors.centerIn: parent
|
|
value: percentage
|
|
|
|
MaterialSymbol {
|
|
font.weight: Font.Medium
|
|
fill: 1
|
|
text: root.iconName
|
|
iconSize: 13
|
|
color: Appearance.colors.colOnSecondaryContainer
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
acceptedButtons: Qt.NoButton
|
|
enabled: root.visible
|
|
}
|
|
|
|
}
|