fix tray menu loading

This commit is contained in:
Zacharias-Brohn
2025-11-17 16:14:08 +01:00
parent a611c548d7
commit 94f041ad4c
3 changed files with 18 additions and 2 deletions
+4 -1
View File
@@ -475,6 +475,8 @@ PanelWindow {
}
RowLayout {
id: actionRow
property NotifServer.Notif notif: groupHeader.modelData
spacing: 2
// visible: groupColumn.isExpanded ? ( groupHeader.modelData.actions.length > 1 ? true : false ) : ( groupColumn.notifications.length === 1 ? ( groupHeader.modelData.actions.length > 1 ? true : false ) : false )
visible: true
@@ -482,7 +484,7 @@ PanelWindow {
width: parent.width
Repeater {
model: groupHeader.modelData.actions
model: [ ...actionRow.notif.actions ]
Rectangle {
id: actionButton
Layout.fillWidth: true
@@ -501,6 +503,7 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
onClicked: {
console.log( groupHeader.modelData.actions );
actionButton.modelData.invoke();
}
}
+7
View File
@@ -12,6 +12,7 @@ MouseArea {
required property SystemTrayItem item
required property PanelWindow bar
property point globalPos
property bool hasLoaded: false
implicitWidth: 22
@@ -54,6 +55,12 @@ MouseArea {
trayMenu.trayMenu = null;
}
}
function onFinishedLoading() {
if ( !root.hasLoaded )
trayMenu.visible = false;
root.hasLoaded = true;
}
}
onClicked: {
+7 -1
View File
@@ -12,6 +12,7 @@ PanelWindow {
id: root
signal menuActionTriggered()
signal finishedLoading()
required property QsMenuHandle trayMenu
required property point trayItemRect
required property PanelWindow bar
@@ -20,6 +21,7 @@ PanelWindow {
property alias focusGrab: grab.active
property int entryHeight: 30
property int biggestWidth: 0
property int menuItemCount: menuOpener.children.values.length
QsMenuOpener {
id: menuOpener
@@ -30,7 +32,7 @@ PanelWindow {
// listLayout.forceLayout();
// }
visible: false
visible: true
color: "transparent"
anchors {
top: true
@@ -198,6 +200,7 @@ PanelWindow {
delegate: Rectangle {
id: menuItem
required property int index
required property QsMenuEntry modelData
property var child: QsMenuOpener {
menu: menuItem.modelData
@@ -218,6 +221,9 @@ PanelWindow {
if ( currentWidth > biggestWidth ) {
root.biggestWidth = currentWidth;
}
if ( menuItem.index === menuOpener.children.values.length - 1 )
root.finishedLoading();
}
TextMetrics {