wbar: tray

This commit is contained in:
end-4
2025-11-16 12:05:09 +01:00
parent c71a2498d0
commit 5b69995945
12 changed files with 264 additions and 40 deletions
@@ -4,43 +4,30 @@ import qs
import qs.services
import qs.modules.common
import qs.modules.waffle.looks
import qs.modules.waffle.bar.tray
BarButton {
BarIconButton {
id: root
visible: Updates.available && Updates.updateAdvised
visible: Updates.updateAdvised || Updates.updateStronglyAdvised
padding: 4
iconName: "arrow-sync"
iconSize: 20 // Needed because the icon appears to have some padding
tooltipText: Translation.tr("Get the latest features and security improvements with\nthe newest feature update.\n\n%1 packages").arg(Updates.count)
onClicked: {
Quickshell.execDetached(["bash", "-c", Config.options.apps.update]);
}
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
}
overlayingItems: Rectangle {
anchors {
right: parent.right
bottom: parent.bottom
margins: 1
}
}
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)
implicitWidth: 8
implicitHeight: implicitWidth
radius: height / 2
color: Updates.updateStronglyAdvised ? Looks.colors.warning : Looks.colors.accent
}
}