Delay binding on the menu width
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 14 Sep 2020 15:36:08 +0000 (17:36 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Tue, 15 Sep 2020 08:46:10 +0000 (08:46 +0000)
Indee the MenuItem might not be linked to its Menu at creation time
which will make the binding fail and give a warning. Delay for the menu
availability.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/tray/UserLine.qml

index a2bedbec3120f7e23ecf88e26e5d3d61fc78a83f..125819b3ea03d66f5ff43c35b9dd323f45902b3f 100644 (file)
@@ -43,7 +43,7 @@ MenuItem {
 \r
                 background: Item {\r
                     height: parent.height\r
-                    width: parent.menu.width\r
+                    width: userLine.menu ? userLine.menu.width : 0\r
                     Rectangle {\r
                         anchors.fill: parent\r
                         anchors.margins: 1\r