DPS_Manage/Component/CustomProgressBar.qml

42 lines
1.0 KiB
QML
Raw Normal View History

2025-05-29 14:04:05 +08:00
import QtQuick 2.15
import QtQuick.Controls 2.15
2025-09-15 09:46:04 +08:00
import HuskarUI.Basic 1.0
2025-05-29 14:04:05 +08:00
Item {
id: progressBarWrapper
width: 120
height: 12
property int minimumValue: 0
property int maximumValue: 100
property int currentValue: 0
Rectangle {
id: backgroundRect
width: progressBarWrapper.width
height: progressBarWrapper.height
color: "lightgray"
radius: 14
Rectangle {
id: progressRect
width: (progressBarWrapper.currentValue - progressBarWrapper.minimumValue) / (progressBarWrapper.maximumValue - progressBarWrapper.minimumValue) * backgroundRect.width
height: backgroundRect.height
color: "#66a333"
radius: 14
}
}
Text {
id: progressText
text: currentValue + "%"
anchors.centerIn: parent
font {
pixelSize: 12
2025-09-15 09:46:04 +08:00
family: HusTheme.Primary.fontPrimaryFamily
2025-05-29 14:04:05 +08:00
bold: true
}
2025-09-15 09:46:04 +08:00
color: HusTheme.Primary.colorTextBase
2025-05-29 14:04:05 +08:00
}
}