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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MAYL7FYuZNTmb4sEaig3bN
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
1cca36f7d3
commit
346c837d77
@@ -59,6 +59,13 @@ void PrefsPanel::onRadioChanged(Firmware * firmware, bool deferUpdate)
|
|||||||
update();
|
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
|
PrefsScrollArea
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class PrefsPanel : public AbstractPanel
|
|||||||
|
|
||||||
AutoLineEdit * newPathWidget(QWidget * parent);
|
AutoLineEdit * newPathWidget(QWidget * parent);
|
||||||
void setPathWidget(AutoLineEdit * wgt);
|
void setPathWidget(AutoLineEdit * wgt);
|
||||||
|
void shrink();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user