From cca2d627635ff178d7cf356d4e10644da7eb77d2 Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 28 Jul 2026 15:05:05 +0100 Subject: [PATCH] quickshell: hold tray menu height so switching morphs instead of regrowing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switching to a tray menu whose items were not currently loaded collapsed fullHeight at the instant of the switch, so the chrome morphed DOWN to a stub and replayed the vertical grow when the items landed, rather than moving across from the previous panel. An empty Card is not height 0 but 2*cardPad, so loaded-ness has to come from the model: menuLoaded tracks menuOpener.children. While a newly assigned menu is loading, fullHeight holds the last loaded height, so the morph stays continuous and the correction on arrival is small — nil when it is the same menu as last time. ui.nix radius knob at 20. Co-Authored-By: Claude Opus 5 --- settings/quickshell.nix | 23 ++++++++++++++++++++++- settings/ui.nix | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 5e80502..a75cb83 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -2108,7 +2108,28 @@ in id: contextMenu property var trayItem: null fullWidth: menuItems.width + 2 * Theme.panelGap - fullHeight: menuItems.height + 2 * Theme.panelGap + + // While a freshly assigned menu is still loading, the Card + // is empty — and an empty Card is not height 0, it is + // 2*cardPad — so the panel would morph DOWN to a stub and + // then regrow once the items land, instead of moving + // across. Hold the last loaded height until the new items + // arrive so the morph stays continuous. The correction is + // small, and nil when it is the same menu as last time. + readonly property bool menuLoaded: + menuOpener.children && menuOpener.children.values.length > 0 + property real lastMenuHeight: 0 + fullHeight: (menuLoaded ? menuItems.height + : Math.max(menuItems.height, lastMenuHeight)) + + 2 * Theme.panelGap + + Connections { + target: menuItems + function onHeightChanged() { + if (contextMenu.menuLoaded) + contextMenu.lastMenuHeight = menuItems.height; + } + } // Deliberately NOT cleared on close. Nulling the menu threw // away the loaded items, and the only thing that refills diff --git a/settings/ui.nix b/settings/ui.nix index c05bd47..8069cf1 100644 --- a/settings/ui.nix +++ b/settings/ui.nix @@ -12,5 +12,5 @@ # Theme.radiusTiny = radius * 0.5 # hyprland decoration.rounding = radius { - radius = 24; + radius = 20; }