forked from Shinonome/dots-hyprland
Rearrange for tidier structure (#2212)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user