feat(balance): pending chip in the Donut, Shield and Timeline layouts too
Extends the labeled "Pending +X" chip (with its awaiting-confirmations tooltip) to three more layouts via a shared DrawPendingChip() helper. It draws on the ticker line (the USD value sits on the line below in these layouts, so there's no overlap) and is skipped if it would overflow the card. The remaining draw-list layouts with right-aligned content (Consolidated, Minimal, the grid variants) are left for a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -97,6 +97,18 @@ bool FormatTotalEarnings(App* app, std::string& outText, ImU32& outCol) {
|
||||
}
|
||||
|
||||
// Render compact hero line: logo + balance + USD + mining on one line
|
||||
float DrawPendingChip(ImDrawList* dl, ImVec2 pos, float maxRight, ImFont* font, float fontSize) {
|
||||
using namespace material;
|
||||
if (s_dispUnconfirmed <= 1e-9) return 0.0f;
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), TR("baltab_pending_chip"), s_dispUnconfirmed);
|
||||
const float w = font->CalcTextSizeA(fontSize, 10000.0f, 0.0f, buf).x;
|
||||
if (pos.x + w > maxRight) return 0.0f; // would overflow the card — skip rather than overlap
|
||||
dl->AddText(font, fontSize, pos, WithAlpha(Warning(), 230), buf);
|
||||
if (IsRectHovered(pos, ImVec2(pos.x + w, pos.y + fontSize))) Tooltip("%s", TR("baltab_pending_tip"));
|
||||
return w;
|
||||
}
|
||||
|
||||
void RenderCompactHero(App* app, ImDrawList* dl, float availW, float hs, float vs, float heroHeightOverride) {
|
||||
using namespace material;
|
||||
char buf[64];
|
||||
|
||||
Reference in New Issue
Block a user