refactor(ui): app-wide compact, translucent tooltips

Add material::Tooltip / BeginTooltip / EndTooltip wrappers (tooltip_style.h)
that scope a small window padding (8x4, dpi-scaled) and ~85% opacity to
tooltips only, then route the tooltip call sites through them. Menus and combo
dropdowns are untouched (they keep the global opaque PopupBg).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-27 21:26:52 -05:00
parent 69a6fb3e64
commit 2e8e214689
24 changed files with 160 additions and 92 deletions

View File

@@ -118,7 +118,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
}
if (soloMiningAvailable && poolHov && !soloMiningActive) ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
if (poolHov && soloMiningActive && !s_pool_mode) {
ImGui::SetTooltip("%s", TR("mining_stop_solo_for_pool"));
material::Tooltip("%s", TR("mining_stop_solo_for_pool"));
}
ImGui::SetCursorScreenPos(ImVec2(tMin.x, tMax.y));
@@ -188,7 +188,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
dl2->AddRectFilled(btnPos, ImVec2(btnPos.x + btnSize.x, btnPos.y + btnSize.y),
StateHover(), 4.0f * dp);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_saved_pools"));
material::Tooltip("%s", TR("mining_saved_pools"));
}
ImFont* icoFont = Type().iconSmall();
const char* dropIcon = ICON_MD_ARROW_DROP_DOWN;
@@ -217,7 +217,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
dl2->AddRectFilled(btnPos, ImVec2(btnPos.x + btnSize.x, btnPos.y + btnSize.y),
StateHover(), 4.0f * dp);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", alreadySaved ? TR("mining_already_saved") : TR("mining_save_pool_url"));
material::Tooltip("%s", alreadySaved ? TR("mining_already_saved") : TR("mining_save_pool_url"));
}
ImFont* icoFont = Type().iconSmall();
const char* saveIcon = alreadySaved ? ICON_MD_BOOKMARK : ICON_MD_BOOKMARK_BORDER;
@@ -293,7 +293,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
if (inXZone) {
pdl->AddRectFilled(xMin, xMax, IM_COL32(255, 80, 80, 30));
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_remove"));
material::Tooltip("%s", TR("mining_remove"));
} else if (rowHov) {
// Show faint X when row is hovered
ImFont* icoF = Type().iconSmall();
@@ -350,9 +350,9 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
if (ImGui::IsItemHovered()) {
std::string currentWorkerStr(s_pool_worker);
if (currentWorkerStr.empty()) {
ImGui::SetTooltip("%s", TR("mining_generate_z_address_hint"));
material::Tooltip("%s", TR("mining_generate_z_address_hint"));
} else {
ImGui::SetTooltip("%s", TR("mining_payout_tooltip"));
material::Tooltip("%s", TR("mining_payout_tooltip"));
}
}
@@ -370,7 +370,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
dl2->AddRectFilled(btnPos, ImVec2(btnPos.x + btnSize.x, btnPos.y + btnSize.y),
StateHover(), 4.0f * dp);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_saved_addresses"));
material::Tooltip("%s", TR("mining_saved_addresses"));
}
ImFont* icoFont = Type().iconSmall();
const char* dropIcon = ICON_MD_ARROW_DROP_DOWN;
@@ -399,7 +399,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
dl2->AddRectFilled(btnPos, ImVec2(btnPos.x + btnSize.x, btnPos.y + btnSize.y),
StateHover(), 4.0f * dp);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", alreadySaved ? TR("mining_already_saved") : TR("mining_save_payout_address"));
material::Tooltip("%s", alreadySaved ? TR("mining_already_saved") : TR("mining_save_payout_address"));
}
ImFont* icoFont = Type().iconSmall();
const char* saveIcon = alreadySaved ? ICON_MD_BOOKMARK : ICON_MD_BOOKMARK_BORDER;
@@ -471,7 +471,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
isCurrent ? Primary() : OnSurface(), addr.c_str());
// Tooltip for long addresses
if (rowHov && !inXZone)
ImGui::SetTooltip("%s", addr.c_str());
material::Tooltip("%s", addr.c_str());
// X button — flush with right edge, icon centered
{
ImVec2 xMin(rowMax.x - wXZoneW, rowMin.y);
@@ -479,7 +479,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
if (inXZone) {
pdl->AddRectFilled(xMin, xMax, IM_COL32(255, 80, 80, 30));
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_remove"));
material::Tooltip("%s", TR("mining_remove"));
} else if (rowHov) {
ImFont* icoF = Type().iconSmall();
const char* xIcon = ICON_MD_CLOSE;
@@ -540,7 +540,7 @@ void RenderMiningModeToggle(App* app, const WalletState& state, const MiningInfo
dl2->AddRectFilled(btnPos, ImVec2(btnPos.x + btnSize.x, btnPos.y + btnSize.y),
StateHover(), 4.0f * dp);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_reset_defaults"));
material::Tooltip("%s", TR("mining_reset_defaults"));
}
// Icon