From 4113dd26be0907f2edf1805c7b9fd23766e17161 Mon Sep 17 00:00:00 2001 From: Joel <43355957+joelwilsonmt@users.noreply.github.com> Date: Thu, 5 Nov 2026 18:12:12 -0700 Subject: [PATCH] Fix toolbar button resize loop when moving between displays (#2093) NavigableToolButton bound its icon size to its background. Material's ToolButton background is half the button height while the content is square, but spans the full button width otherwise. When the window straddles a 2x and a 1x display, the header row briefly lays out at a smaller height, the content stops being square, and the icon width becomes the button width. The button's implicit width is then icon + padding, so every layout pass widens it by 12px without end and reloads the SVG icon at each new size. The UI hangs and memory grows until the process is killed. Size the icon from the button's own height instead. That height comes from Layout.preferredHeight, not from the icon, so there's no feedback loop, and the icon stays 30x30 in the 60px toolbar as before. Fixes #2092 --- app/gui/NavigableToolButton.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/gui/NavigableToolButton.qml b/app/gui/NavigableToolButton.qml index 9839196c..97c0ea90 100644 --- a/app/gui/NavigableToolButton.qml +++ b/app/gui/NavigableToolButton.qml @@ -8,8 +8,12 @@ ToolButton { activeFocusOnTab: true icon.source: iconSource - icon.width: background.width - icon.height: background.height + // Size the icon from the button's height rather than its background. + // Material's background spans the full button width when the content + // isn't square, so binding the icon to it feeds the button's width back + // into its own implicit width and the toolbar layout grows without bound. + icon.width: height / 2 + icon.height: height / 2 // This determines the size of the Material highlight. We increase it // from the default because we use larger than normal icons for TV readability.