From: Stephan Beyer Date: Mon, 6 Jul 2020 18:12:58 +0000 (+0200) Subject: Set maximum height of account and app menu X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~108 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e32bd75519dbd4b419435f0ffb04adfcb4d4da47;p=nextcloud-desktop.git Set maximum height of account and app menu The menus may become too large if they have too many items (the account menu has this in case of many accounts, the apps menu in case of many apps). This commit limits the maximum height such that the menus do not hide the header. Signed-off-by: Stephan Beyer --- diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 18c593a50..1efb8212b 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -19,6 +19,8 @@ Window { color: "transparent" flags: Qt.Dialog | Qt.FramelessWindowHint + readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth + // Close tray window when focus is lost (e.g. click somewhere else on the screen) onActiveChanged: { if(!active) { @@ -145,6 +147,7 @@ Window { y: (currentAccountButton.y + Style.trayWindowHeaderHeight + 2) width: (Style.currentAccountButtonWidth - 2) + height: Math.min(implicitHeight, maxMenuHeight) closePolicy: "CloseOnPressOutside" background: Rectangle { @@ -437,6 +440,7 @@ Window { y: (trayWindowAppsButton.y + trayWindowAppsButton.height + 2) readonly property Item listContentItem: contentItem.contentItem width: Math.min(listContentItem.childrenRect.width + 4, Style.trayWindowWidth / 2) + height: Math.min(implicitHeight, maxMenuHeight) closePolicy: "CloseOnPressOutside" background: Rectangle {