From 346c837d77d23932d860fe8b4c794b3f6ba074fb Mon Sep 17 00:00:00 2001 From: Peter Feerick <5500713+pfeerick@users.noreply.github.com> Date: Mon, 14 Sep 2026 17:43:40 +1000 Subject: [PATCH] fix(cpn): Application tab content disappearing when collapsing a section PrefsAppPanel/PrefsProfilePanel/PrefsUpdatePanel wire every AutoCollapsibleSection's animation-finished callback to AbstractPanel::shrink(), which does adjustSize() followed by resize(0, 0) to force a re-layout. That idiom is only safe for the top-level QDialogs it was copied from elsewhere in Companion; these panels are child widgets hosted in a QScrollArea, and forcing them to (0, 0) can leave them stuck at zero size instead of being regrown by the scroll area - blanking the whole tab, e.g. when collapsing "Radio Profiles" on the Application tab while "General" is left expanded. Give PrefsPanel its own non-destructive shrink() (updateGeometry()) that shadows AbstractPanel::shrink() for these scroll-area-hosted panels. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01MAYL7FYuZNTmb4sEaig3bN --- companion/src/prefsedit/prefs_panel.cpp | 7 +++++++ companion/src/prefsedit/prefs_panel.h | 1 + 2 files changed, 8 insertions(+) diff --git a/companion/src/prefsedit/prefs_panel.cpp b/companion/src/prefsedit/prefs_panel.cpp index 926839162..8038cec72 100644 --- a/companion/src/prefsedit/prefs_panel.cpp +++ b/companion/src/prefsedit/prefs_panel.cpp @@ -59,6 +59,13 @@ void PrefsPanel::onRadioChanged(Firmware * firmware, bool deferUpdate) update(); } +void PrefsPanel::shrink() +{ + // resize(0,0) (AbstractPanel::shrink()) assumes a top-level widget; here the + // panel lives in a QScrollArea and can get stuck at zero size instead. + updateGeometry(); +} + /* PrefsScrollArea */ diff --git a/companion/src/prefsedit/prefs_panel.h b/companion/src/prefsedit/prefs_panel.h index 19c4c86fe..bc263678a 100644 --- a/companion/src/prefsedit/prefs_panel.h +++ b/companion/src/prefsedit/prefs_panel.h @@ -61,6 +61,7 @@ class PrefsPanel : public AbstractPanel AutoLineEdit * newPathWidget(QWidget * parent); void setPathWidget(AutoLineEdit * wgt); + void shrink(); };