36 lines
1.1 KiB
QML
36 lines
1.1 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
Button {
|
|
id: root
|
|
implicitHeight: 44
|
|
font.pixelSize: 15
|
|
font.bold: true
|
|
|
|
property int packageCount: 0
|
|
property int status: 0
|
|
|
|
enabled: status === ProcessManager.Status.Null && root.packageCount > 0
|
|
visible: status !== ProcessManager.Status.Updating
|
|
&& status !== ProcessManager.Status.Installing
|
|
&& status !== ProcessManager.Status.Removing
|
|
text: status === ProcessManager.Status.Updating ? "Обновление..." : status === ProcessManager.Status.Checking ? "Проверка..." : root.packageCount > 0 ? "Обновить систему" : "✓ Всё обновлено"
|
|
|
|
background: Rectangle {
|
|
radius: 1
|
|
color: !root.enabled ? Theme.color5 : root.down ? Theme.color11 : root.hovered ? Theme.color6 : Theme.color10
|
|
border.width: root.visualFocus ? 2 : 0
|
|
border.color: Theme.color2
|
|
|
|
Behavior on color { ColorAnimation { duration: 100 } }
|
|
}
|
|
|
|
contentItem: Text {
|
|
text: root.text
|
|
font: root.font
|
|
color: root.enabled ? Theme.color8 : Theme.color12
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|