forked from Shinonome/dots-hyprland
wbar: add updates indicator
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import QtQuick
|
||||
import qs
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.waffle.looks
|
||||
|
||||
BarButton {
|
||||
id: root
|
||||
|
||||
visible: Updates.available && Updates.updateAdvised
|
||||
|
||||
padding: 4
|
||||
contentItem: Item {
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: iconContent.implicitWidth
|
||||
implicitHeight: iconContent.implicitHeight
|
||||
|
||||
FluentIcon {
|
||||
id: iconContent
|
||||
anchors.centerIn: parent
|
||||
icon: "arrow-sync"
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 1
|
||||
}
|
||||
implicitWidth: 8
|
||||
implicitHeight: implicitWidth
|
||||
radius: height / 2
|
||||
color: Updates.updateStronglyAdvised ? Looks.colors.warning : Looks.colors.accent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarToolTip {
|
||||
extraVisibleCondition: root.shouldShowTooltip
|
||||
text: Translation.tr("Get the latest features and security improvements with\nthe newest feature update.\n\n%1 packages").arg(Updates.count)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user