wbar: add updates indicator

This commit is contained in:
end-4
2025-11-15 21:30:28 +01:00
parent 6ee7212bdc
commit fdc38d69f7
13 changed files with 194 additions and 20 deletions
@@ -11,8 +11,10 @@ BarPopup {
id: root
default property var menuData
property var model: [
{iconName: "start-here", text: "Start", action: () => {print("hello")}}
{ iconName: "start-here", text: "Start", action: () => {print("hello")} },
{ type : "separator" },
]
readonly property bool hasIcons: model.some(item => item.iconName !== undefined && item.iconName !== "")
padding: 2
contentItem: ColumnLayout {
@@ -21,18 +23,35 @@ BarPopup {
Repeater {
model: root.model
delegate: WButton {
id: btn
Layout.fillWidth: true
delegate: DelegateChooser {
role: "type"
DelegateChoice {
roleValue: "separator"
Rectangle {
Layout.topMargin: 2
Layout.bottomMargin: 2
Layout.fillWidth: true
implicitHeight: 1
color: Looks.colors.bg0Border
}
}
DelegateChoice {
roleValue: undefined
WButton {
id: btn
Layout.fillWidth: true
required property var modelData
icon.name: modelData.iconName ? modelData.iconName : ""
monochromeIcon: modelData.monochromeIcon ?? true
text: modelData.text ? modelData.text : ""
required property var modelData
forceShowIcon: root.hasIcons
icon.name: modelData.iconName ? modelData.iconName : ""
monochromeIcon: modelData.monochromeIcon ?? true
text: modelData.text ? modelData.text : ""
onClicked: {
if (modelData.action) modelData.action();
root.close();
onClicked: {
if (modelData.action) modelData.action();
root.close();
}
}
}
}
}