fix(ui): scale unscaled geometry at HiDPI — inputs, send progress cards, chat/pool overlaps, peer rows
At font_scale 1.5 ~13 sites read absolute geometry (schema .size/.width) straight into ImGui without ×dpiScale(), so they stayed native-size while the font grew and overlapped/clipped real text or money: - Shield/Merge fee + UTXO inputs, Request Payment amount, Block Info height input: ×dpiScale() so the value no longer clips (e.g. 0.00010000 -> 0.00010). - Send: the confirm-popup Amount Details divider (floored the row step at the scaled caption height so it no longer strikes the Fee row), the tx-progress error and sending/success cards, and the zero-balance CTA button — all ×dp. - Mining pool row: ellipsis-truncate the hostname so it can't collide with the right-aligned hashrate. - Chat conversation list: scale the pane-width clamp AND clip the peer name to the column left of the timestamp (measure-then-clip) so name and time never overlap. - Explorer block-detail label column, Peers row offsets, and DialogConfirmFooter button height — ×dp. transaction_details keeps its negative fill-sentinel widths unscaled (a content margin, not raw px). Verified at font_scale 1.5 across full-node + Lite + Windows (ctest green) and an adversarial diff review (three wrong-scale regressions fixed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -312,11 +312,11 @@ static void RenderLeftPoolCard(App* app, const WalletState& state, ImDrawList* d
|
||||
isCurrent ? Success() : OnSurfaceDisabled());
|
||||
|
||||
const float textY = rMin.y + (listRowH - capFont->LegacySize) * 0.5f;
|
||||
// Show the short host label (the narrow card can't fit host:port); the
|
||||
// full stratum URL is in the hover tooltip.
|
||||
cdl->AddText(capFont, capFont->LegacySize, ImVec2(rMin.x + 16 * dp, textY),
|
||||
isCurrent ? Primary() : OnSurface(), kp.label.c_str());
|
||||
|
||||
// Build the right-side "<hashrate> N% fee" run first so we know its width
|
||||
// and can bound (and ellipsis-truncate) the left host label to avoid a
|
||||
// collision — both text runs grow ~1.5x at font_scale 1.5 while the card
|
||||
// width barely does.
|
||||
char right[64];
|
||||
std::string hrStr = haveHr ? FormatHashrate(it->second.hashrateHs) : std::string("—");
|
||||
// Prefer the live fee the pool reports; fall back to the compile-time
|
||||
@@ -331,6 +331,16 @@ static void RenderLeftPoolCard(App* app, const WalletState& state, ImDrawList* d
|
||||
else
|
||||
snprintf(right, sizeof(right), "%s", hrStr.c_str());
|
||||
ImVec2 rSz = capFont->CalcTextSizeA(capFont->LegacySize, FLT_MAX, 0, right);
|
||||
|
||||
// Show the short host label (the narrow card can't fit host:port); the
|
||||
// full stratum URL is in the hover tooltip. Truncate it to the gap left
|
||||
// of the right-side run so a long hostname can't overlap the hashrate.
|
||||
const float labelX = rMin.x + 16 * dp;
|
||||
const float labelMaxW = (rMax.x - rSz.x - 6 * dp - gap) - labelX;
|
||||
std::string label = TruncateToWidth(kp.label, capFont, capFont->LegacySize, labelMaxW);
|
||||
cdl->AddText(capFont, capFont->LegacySize, ImVec2(labelX, textY),
|
||||
isCurrent ? Primary() : OnSurface(), label.c_str());
|
||||
|
||||
cdl->AddText(capFont, capFont->LegacySize,
|
||||
ImVec2(rMax.x - rSz.x - 6 * dp, textY), OnSurfaceMedium(), right);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user