feat(balance): inline period-earnings in the address list and totals
Surfaces the period-earnings aggregator in the Balance tab: - Toolbar (shared address list): interval pills (1H/1D/1M/1Y), a received- vs-net mode toggle, and a global show-all toggle, placed right of "Hide 0 Balances". The New Z-Address / New mining address buttons move to a footer row across from "Showing X of Y" to make room. - Per address: the row draws its earnings on line 2, left of the $USD value (green positive, red negative in net mode), shown when the global toggle is on or the address is opted in via a new "Show/Hide earnings" right-click item. Works in every layout via the shared list. - Total: FormatTotalEarnings (gated on the global toggle, so the default appearance is unchanged) is wired into the compact hero (dashboard/minimal) and the classic layout, left of / beside their USD figure. The remaining layouts' totals are not wired yet. - Settings > Appearance: an "Earnings Display Format" selector (Coin / Coin + fiat / Fiat). New i18n keys are translated into all eight locales; the CJK subset font is rebuilt for the new glyphs. Builds + test suites pass on both variants. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -364,7 +364,7 @@ static void RenderBalanceClassic(App* app)
|
||||
OnSurfaceMedium(), DRAGONX_TICKER);
|
||||
cy += sub1->LegacySize + valGap;
|
||||
|
||||
// USD value
|
||||
// USD value (+ total period-earnings to its right when the earnings toggle is on)
|
||||
{
|
||||
double usd_value = state.getBalanceUSD();
|
||||
if (usd_value > 0.0)
|
||||
@@ -373,6 +373,12 @@ static void RenderBalanceClassic(App* app)
|
||||
snprintf(buf, sizeof(buf), "$-.-- USD");
|
||||
dl->AddText(capFont, capFont->LegacySize, ImVec2(cx, cy),
|
||||
OnSurfaceDisabled(), buf);
|
||||
std::string earnText; ImU32 earnCol;
|
||||
if (FormatTotalEarnings(app, earnText, earnCol)) {
|
||||
float usdW = capFont->CalcTextSizeA(capFont->LegacySize, 10000, 0, buf).x;
|
||||
dl->AddText(capFont, capFont->LegacySize,
|
||||
ImVec2(cx + usdW + tickGap * 3.0f, cy), earnCol, earnText.c_str());
|
||||
}
|
||||
}
|
||||
cy += capFont->LegacySize + 2 * dp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user