From b98cf0a0291d48c9b7a771f6c839445068183815 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 6 Jul 2020 14:44:23 +0200 Subject: [PATCH] Reach out to the contentItem inside of the ListView to find the width Turns out that the ListView embedded in the Menu (reachable via contentItem) would create a binding loop if we're using its childrenRect. But really we're interested in the total width for the instantiated delegate *inside* the ListView. That's why we go one level deeper and get the childrenRect of the inner contentItem instead. Signed-off-by: Kevin Ottens --- src/gui/tray/Window.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index aa8063460..18c593a50 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -435,7 +435,8 @@ Window { Menu { id: appsMenu y: (trayWindowAppsButton.y + trayWindowAppsButton.height + 2) - width: Math.min(contentItem.childrenRect.width + 4, Style.trayWindowWidth / 2) + readonly property Item listContentItem: contentItem.contentItem + width: Math.min(listContentItem.childrenRect.width + 4, Style.trayWindowWidth / 2) closePolicy: "CloseOnPressOutside" background: Rectangle { -- 2.30.2