From: Kevin Ottens Date: Mon, 6 Jul 2020 12:44:23 +0000 (+0200) Subject: Reach out to the contentItem inside of the ListView to find the width X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~110^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b98cf0a0291d48c9b7a771f6c839445068183815;p=nextcloud-desktop.git 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 --- 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 {