feat(balance,notifications): shielded-card tooltip + clearer toast severity

- The Shielded balance card gains the explanatory hover tooltip the mining card
  already has (suppressed while the pending-chip tooltip is showing).
- Toasts get a severity-tinted background fill and a slightly thicker accent
  border, so Success/Warning/Error/Info differ by more than hue alone (the
  per-severity leading icon already existed). Tint opacity is a ui.toml token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-18 18:36:55 -05:00
co-authored by Claude Opus 4.8
parent b3e09a3314
commit ee6e99965c
3 changed files with 12 additions and 2 deletions
+1
View File
@@ -1225,6 +1225,7 @@ pill-margin-y = { size = 3.0 }
pill-rounding = { size = 12.0 }
padding-x = { size = 12.0 }
glass-fill-alpha = { size = 18.0 }
accent-fill-alpha = { size = 0.22 } # severity-tint fill opacity (fraction of the accent alpha)
glass-border-alpha = { size = 35.0 }
progress-bar-height = { size = 2.0 }
duration-info = { size = 1.0 }
+8 -1
View File
@@ -123,9 +123,16 @@ void Notifications::render()
glassSpec.borderWidth = 1.0f;
material::DrawGlassPanel(dl, pMin, pMax, glassSpec);
// Severity-tinted fill so the toast differs by more than hue (helps when color alone is hard to read).
{
ImVec4 tint = accent_color; // already premultiplied by fade `alpha`
tint.w *= nde("accent-fill-alpha", 0.22f);
dl->AddRectFilled(pMin, pMax, ImGui::ColorConvertFloat4ToU32(tint), pillRounding);
}
// Colored accent border on top of the glass border for type indication
ImU32 accentCol = ImGui::ColorConvertFloat4ToU32(accent_color);
dl->AddRect(pMin, pMax, accentCol, pillRounding, 0, 1.0f);
dl->AddRect(pMin, pMax, accentCol, pillRounding, 0, 1.5f * dp);
// Progress bar at bottom of pill (accent-colored), clipped to pill rounded
// corners. Draw a full-pill-size rounded rect and clip it to just the
+3 -1
View File
@@ -526,6 +526,7 @@ static void RenderBalanceClassic(App* app)
}
// Pending badge (top-right corner) — labeled so an unconfirmed "+X" doesn't read as a mystery.
bool pendingChipHovered = false;
if (state.unconfirmed_balance > 0.0) {
snprintf(buf, sizeof(buf), TR("baltab_pending_chip"), state.unconfirmed_balance);
ImVec2 ts = capFont->CalcTextSizeA(
@@ -540,7 +541,7 @@ static void RenderBalanceClassic(App* app)
dl->AddText(capFont, capFont->LegacySize,
ImVec2(bMin.x + bp, bMin.y + bp * 0.5f),
amberCol, buf);
if (material::IsRectHovered(bMin, bMax)) material::Tooltip("%s", TR("baltab_pending_tip"));
if (material::IsRectHovered(bMin, bMax)) { pendingChipHovered = true; material::Tooltip("%s", TR("baltab_pending_tip")); }
}
// Hover glow + click to Receive
@@ -548,6 +549,7 @@ static void RenderBalanceClassic(App* app)
dl->AddRect(cMin, cMax, IM_COL32(255, 255, 255, (int)S.drawElement("tabs.balance", "hover-glow-alpha").sizeOr(40.0f)),
cardSpec.rounding, 0, S.drawElement("tabs.balance", "hover-glow-thickness").sizeOr(1.5f) * dp);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
if (!pendingChipHovered) material::Tooltip("%s", TR("shielded_card_tooltip"));
if (ImGui::IsMouseClicked(0))
app->setCurrentPage(NavPage::Receive);
}