mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
41 lines
1.1 KiB
QML
41 lines
1.1 KiB
QML
import qs.modules.common
|
|
import qs.modules.common.functions
|
|
import qs.modules.common.widgets
|
|
import QtQuick
|
|
|
|
Item {
|
|
id: root
|
|
required property string iconName
|
|
required property double percentage
|
|
property int warningThreshold: 100
|
|
implicitHeight: resourceProgress.implicitHeight
|
|
implicitWidth: Appearance.sizes.verticalBarWidth
|
|
|
|
property bool warning: percentage * 100 >= warningThreshold
|
|
|
|
ClippedFilledCircularProgress {
|
|
id: resourceProgress
|
|
anchors.centerIn: parent
|
|
value: percentage
|
|
enableAnimation: false
|
|
colPrimary: root.warning ? Appearance.colors.colError : Appearance.colors.colOnSecondaryContainer
|
|
accountForLightBleeding: !root.warning
|
|
|
|
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
|
|
}
|
|
}
|