From e32bd75519dbd4b419435f0ffb04adfcb4d4da47 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Mon, 6 Jul 2020 20:12:58 +0200 Subject: [PATCH] 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 --- src/gui/tray/Window.qml | 4 ++++ 1 file changed, 4 insertions(+) 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 {