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:
@@ -296,7 +296,7 @@ static void RenderSourceDropdown(App* app, float width) {
|
||||
addr.address.c_str());
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("%s\nBalance: %.8f %s",
|
||||
material::Tooltip("%s\nBalance: %.8f %s",
|
||||
addr.address.c_str(), addr.balance, DRAGONX_TICKER);
|
||||
}
|
||||
ImGui::PopID();
|
||||
@@ -351,7 +351,7 @@ static void RenderAddressSuggestions(const WalletState& state, float width, cons
|
||||
snprintf(s_to_address, sizeof(s_to_address), "%s", suggestions[si].c_str());
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("%s", suggestions[si].c_str());
|
||||
material::Tooltip("%s", suggestions[si].c_str());
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
@@ -472,7 +472,7 @@ static void RenderAmountBar(ImDrawList* dl, double available, float innerW,
|
||||
snprintf(tipBuf, sizeof(tipBuf), "%.8f / %.8f %s (%.1f%%)",
|
||||
s_amount, maxAmount > 0 ? maxAmount : 0.0, DRAGONX_TICKER,
|
||||
progress * 100.0f);
|
||||
ImGui::SetTooltip("%s", tipBuf);
|
||||
material::Tooltip("%s", tipBuf);
|
||||
}
|
||||
|
||||
// Glass thumb circle at the fill edge
|
||||
@@ -925,19 +925,19 @@ static void RenderActionButtons(App* app, float width, float vScale,
|
||||
|
||||
if (!can_send && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
|
||||
if (!app->isConnected())
|
||||
ImGui::SetTooltip("%s", TR(app->isLiteBuild() ? "lite_no_wallet_short" : "send_tooltip_not_connected"));
|
||||
material::Tooltip("%s", TR(app->isLiteBuild() ? "lite_no_wallet_short" : "send_tooltip_not_connected"));
|
||||
else if (state.sync.syncing)
|
||||
ImGui::SetTooltip("%s", TR("send_tooltip_syncing"));
|
||||
material::Tooltip("%s", TR("send_tooltip_syncing"));
|
||||
else if (s_from_address[0] == '\0')
|
||||
ImGui::SetTooltip("%s", TR("send_tooltip_select_source"));
|
||||
material::Tooltip("%s", TR("send_tooltip_select_source"));
|
||||
else if (!is_valid_address)
|
||||
ImGui::SetTooltip("%s", TR("send_tooltip_invalid_address"));
|
||||
material::Tooltip("%s", TR("send_tooltip_invalid_address"));
|
||||
else if (s_amount <= 0)
|
||||
ImGui::SetTooltip("%s", TR("send_tooltip_enter_amount"));
|
||||
material::Tooltip("%s", TR("send_tooltip_enter_amount"));
|
||||
else if (total > available)
|
||||
ImGui::SetTooltip("%s", TR("send_tooltip_exceeds_balance"));
|
||||
material::Tooltip("%s", TR("send_tooltip_exceeds_balance"));
|
||||
else if (s_sending)
|
||||
ImGui::SetTooltip("%s", TR("send_tooltip_in_progress"));
|
||||
material::Tooltip("%s", TR("send_tooltip_in_progress"));
|
||||
}
|
||||
if (!can_send) ImGui::PopStyleColor(3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user