fix(wallets): stop the modal bottom section sliding off-screen after a monitor move
The Wallets modal used the auto-height BeginOverlayDialog overload, whose content child is AutoResizeY. It sized its table with `tableH = GetContentRegionAvail().y - 130*dp` INSIDE that child — but on an AutoResizeY child GetContentRegionAvail().y derives from the child's Size.y, carried over from the previous frame's content height. That makes tableH self-referential: a fixed point on one monitor, but a monitor move jumps dpiScale() (the 130*dp reserve + table column/row sizes switch to new units while the child's Size.y is still old units), knocking it off equilibrium. With only a lower clamp and no upper bound, the excursion runs unbounded and pushes the create/folder/footer rows off the bottom. Give the dialog a FIXED cardHeight (620) via the spec form — the pattern Manage Portfolio already uses. The content child is then fixed-height (not AutoResizeY), so GetContentRegionAvail().y is a stable, DPI-current "space left in the card", tableH stops feeding back, and the fixed-height path already clamps the card to the viewport (min(cardHeight*dp, vp_size.y-32)). Root-caused via a multi-agent audit against the ImGui internals. Verified via the headless sweep at 100% and font_scale 1.5 (150%): the table absorbs the slack and the create/folder inputs + footer stay on-screen. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,19 @@ public:
|
|||||||
|
|
||||||
if (s_needScan) { scan(); s_needScan = false; }
|
if (s_needScan) { scan(); s_needScan = false; }
|
||||||
|
|
||||||
if (BeginOverlayDialog(TR("wallets_title"), &s_open, 780.0f, 0.94f)) {
|
// FIXED cardHeight (not the auto-height overload): the table below sizes itself from
|
||||||
|
// GetContentRegionAvail().y, which is only stable when the dialog's content child is
|
||||||
|
// fixed-height. Auto-height makes that read self-referential and it diverges across a
|
||||||
|
// monitor move (dpiScale jump), sliding the create/footer rows off-screen. See Manage
|
||||||
|
// Portfolio (market_tab.cpp) for the same fixed-height pattern.
|
||||||
|
OverlayDialogSpec ov;
|
||||||
|
ov.title = TR("wallets_title");
|
||||||
|
ov.p_open = &s_open;
|
||||||
|
ov.style = OverlayStyle::BlurFloat;
|
||||||
|
ov.cardWidth = 780.0f;
|
||||||
|
ov.cardHeight = 620.0f;
|
||||||
|
ov.idSuffix = "wallets";
|
||||||
|
if (BeginOverlayDialog(ov)) {
|
||||||
Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), TR("wallets_intro"));
|
Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), TR("wallets_intro"));
|
||||||
ImGui::Dummy(ImVec2(0, Layout::spacingSm()));
|
ImGui::Dummy(ImVec2(0, Layout::spacingSm()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user