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

@@ -1024,7 +1024,7 @@ void App::renderFirstRunWizard() {
}
ImGui::EndDisabled();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Download from mirror (bootstrap2.dragonx.is).\nUse this if the main download is slow or failing.");
ui::material::Tooltip("Download from mirror (bootstrap2.dragonx.is).\nUse this if the main download is slow or failing.");
}
ImGui::PopStyleVar();
ImGui::PopStyleColor(3);

View File

@@ -7,6 +7,7 @@
#include "../colors.h"
#include "../typography.h"
#include "../layout.h"
#include "../tooltip_style.h"
#include "imgui.h"
#include "imgui_internal.h"
@@ -271,7 +272,7 @@ inline bool IconButton(const char* icon, const char* tooltip, bool enabled) {
// Tooltip
if (tooltip && hovered) {
ImGui::SetTooltip("%s", tooltip);
material::Tooltip("%s", tooltip);
}
return pressed && enabled;

View File

@@ -6,6 +6,7 @@
#include "colors.h"
#include "type.h"
#include "tooltip_style.h"
#include "../layout.h"
#include "../schema/element_styles.h"
#include "../schema/color_var_resolver.h"

View File

@@ -0,0 +1,66 @@
// DragonX Wallet - ImGui Edition
// Copyright 2024-2026 The Hush Developers
// Released under the GPLv3
//
// App-wide tooltip styling: a compact (small padding) and slightly-translucent tooltip. ImGui has
// no tooltip-specific padding (tooltips inherit WindowPadding, shared with every window) and PopupBg
// is shared with menus/combos, so we can't restyle tooltips via the global style without side
// effects. Instead, every tooltip goes through these wrappers, which scope the style to the tooltip:
// dragonx::ui::material::Tooltip("fmt", ...); // replaces ImGui::SetTooltip
// if (material::BeginTooltip()) { ...; material::EndTooltip(); } // replaces ImGui::Begin/EndTooltip
#pragma once
#include <cstdarg>
#include "imgui.h"
#include "../layout.h"
namespace dragonx {
namespace ui {
namespace material {
// Scope tooltip-only styling: small padding + a slightly-transparent background.
inline void PushTooltipStyle()
{
const float s = Layout::dpiScale();
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.0f * s, 4.0f * s));
ImVec4 bg = ImGui::GetStyle().Colors[ImGuiCol_PopupBg];
bg.w = 0.85f; // slightly transparent (the global PopupBg is ~0.98 opaque)
ImGui::PushStyleColor(ImGuiCol_PopupBg, bg);
}
inline void PopTooltipStyle()
{
ImGui::PopStyleColor();
ImGui::PopStyleVar();
}
// Drop-in replacement for ImGui::SetTooltip (same printf-style signature). (No IM_FMTARGS: GCC
// rejects the format attribute on an inline definition; call sites already passed SetTooltip's check.)
inline void Tooltip(const char* fmt, ...)
{
PushTooltipStyle();
va_list args;
va_start(args, fmt);
ImGui::SetTooltipV(fmt, args);
va_end(args);
PopTooltipStyle();
}
// Drop-in replacements for ImGui::BeginTooltip / ImGui::EndTooltip (must be paired, as before).
inline bool BeginTooltip()
{
PushTooltipStyle();
return ImGui::BeginTooltip();
}
inline void EndTooltip()
{
ImGui::EndTooltip();
PopTooltipStyle();
}
} // namespace material
} // namespace ui
} // namespace dragonx

View File

@@ -690,7 +690,7 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
} else {
float iconCX = (indMin.x + indMax.x) * 0.5f;
DrawNavIcon(dl, item.page, iconCX, iconCY, iconS, textCol);
if (hovered) ImGui::SetTooltip("%s", NavLabel(item));
if (hovered) material::Tooltip("%s", NavLabel(item));
}
// Badge indicator
@@ -826,7 +826,7 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
ImVec2 iconSz = iconFont->CalcTextSizeA(eIconFsz, 1000.0f, 0.0f, exitIcon);
dl->AddText(iconFont, eIconFsz,
ImVec2(cx - iconSz.x * 0.5f, cy - iconSz.y * 0.5f), exitCol, exitIcon);
if (exitHover) ImGui::SetTooltip("%s", TR("exit"));
if (exitHover) material::Tooltip("%s", TR("exit"));
}
}

View File

@@ -258,7 +258,7 @@ void AddressBookDialog::render(App* app)
}
ImGui::TextDisabled("%s", addr_display.c_str());
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", entry.address.c_str());
material::Tooltip("%s", entry.address.c_str());
}
ImGui::TableNextColumn();

View File

@@ -172,7 +172,7 @@ public:
ImGui::PushID(i);
ImGui::InvisibleButton("##icon", ImVec2(cellSz, cellSz));
if (ImGui::IsItemClicked()) s_selectedIcon = i;
if (hov) ImGui::SetTooltip("%s", iconName);
if (hov) material::Tooltip("%s", iconName);
ImGui::PopID();
col = (col + 1) % cols;

View File

@@ -385,13 +385,13 @@ void RenderSharedAddressList(App* app, float listH, float availW,
// edge of a row = reorder (move here).
if (s_dropTargetIdx >= 0 && s_dropTargetIdx < (int)rows.size() && s_dropMode == 0) {
const auto& target = rows[s_dropTargetIdx];
ImGui::SetTooltip("%s\n%s\n\n%s %s",
material::Tooltip("%s\n%s\n\n%s %s",
truncateAddress(addr.address, 32).c_str(),
row.isZ ? TR("shielded") : TR("transparent"),
TR("transfer_to"),
truncateAddress(target.info->address, 32).c_str());
} else {
ImGui::SetTooltip("%s\n%s\n\n%s",
material::Tooltip("%s\n%s\n\n%s",
truncateAddress(addr.address, 32).c_str(),
row.isZ ? TR("shielded") : TR("transparent"),
TR("address_reorder_hint"));
@@ -474,7 +474,7 @@ void RenderSharedAddressList(App* app, float listH, float availW,
else app->favoriteAddress(addr.address);
btnClicked = true;
}
if (bHov) ImGui::SetTooltip("%s", row.favorite ? TR("remove_favorite") : TR("favorite_address"));
if (bHov) material::Tooltip("%s", row.favorite ? TR("remove_favorite") : TR("favorite_address"));
}
// Eye button (zero balance or hidden)
@@ -500,7 +500,7 @@ void RenderSharedAddressList(App* app, float listH, float availW,
else app->hideAddress(addr.address);
btnClicked = true;
}
if (bHov) ImGui::SetTooltip("%s", row.hidden ? TR("restore_address") : TR("hide_address"));
if (bHov) material::Tooltip("%s", row.hidden ? TR("restore_address") : TR("hide_address"));
}
// ---- Type icon or custom icon ----
@@ -624,7 +624,7 @@ void RenderSharedAddressList(App* app, float listH, float availW,
ImGui::SetCursorScreenPos(ImVec2(rowPos.x, rowY[row_idx]));
ImGui::InvisibleButton("##addr", ImVec2(innerW, rowH));
if (ImGui::IsItemHovered() && !s_dragActive) {
ImGui::SetTooltip("%s", addr.address.c_str());
material::Tooltip("%s", addr.address.c_str());
}
// Context menu

View File

@@ -904,7 +904,7 @@ static void RenderBalanceClassic(App* app)
else app->favoriteAddress(addr.address);
btnClicked = true;
}
if (bHov) ImGui::SetTooltip("%s", row.favorite ? TR("remove_favorite") : TR("favorite_address"));
if (bHov) material::Tooltip("%s", row.favorite ? TR("remove_favorite") : TR("favorite_address"));
}
// Eye button (zero balance or hidden)
@@ -926,7 +926,7 @@ static void RenderBalanceClassic(App* app)
else app->hideAddress(addr.address);
btnClicked = true;
}
if (bHov) ImGui::SetTooltip("%s", row.hidden ? TR("restore_address") : TR("hide_address"));
if (bHov) material::Tooltip("%s", row.hidden ? TR("restore_address") : TR("hide_address"));
}
// Content zone ends before buttons
@@ -1023,7 +1023,7 @@ static void RenderBalanceClassic(App* app)
// Tooltip with full address
if (ImGui::IsItemHovered() && !btnClicked) {
ImGui::SetTooltip("%s", addr.address.c_str());
material::Tooltip("%s", addr.address.c_str());
}
// Right-click context menu
@@ -1180,7 +1180,7 @@ static void RenderBalanceClassic(App* app)
// Show the full, untruncated address — two z-addresses can truncate to the
// same first/last window, so the truncated text alone can't disambiguate.
if (!tx.address.empty())
ImGui::SetTooltip("%s", tx.address.c_str());
material::Tooltip("%s", tx.address.c_str());
if (ImGui::IsMouseClicked(0))
app->setCurrentPage(NavPage::History);
}

View File

@@ -179,7 +179,7 @@ void BlockInfoDialog::render(App* app)
ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("click_to_copy"));
material::Tooltip("%s", TR("click_to_copy"));
}
if (ImGui::IsItemClicked()) {
ImGui::SetClipboardText(s_block_hash.c_str());
@@ -257,7 +257,7 @@ void BlockInfoDialog::render(App* app)
ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("block_click_prev"));
material::Tooltip("%s", TR("block_click_prev"));
}
if (ImGui::IsItemClicked() && s_height > 1) {
s_height--;
@@ -279,7 +279,7 @@ void BlockInfoDialog::render(App* app)
ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("block_click_next"));
material::Tooltip("%s", TR("block_click_next"));
}
if (ImGui::IsItemClicked()) {
s_height++;

View File

@@ -127,7 +127,7 @@ private:
startDownload(mirrorUrl);
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("bootstrap_mirror_tooltip"));
material::Tooltip("%s", TR("bootstrap_mirror_tooltip"));
}
ImGui::SameLine();
if (TactileButton(TR("cancel"), ImVec2(btnSm, 0))) {

View File

@@ -493,7 +493,7 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
s_prev_daemon_enabled = s_daemon_messages_enabled;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("console_show_daemon_output"));
material::Tooltip("%s", TR("console_show_daemon_output"));
}
ImGui::SameLine();
@@ -511,7 +511,7 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
s_prev_errors_only = s_errors_only_enabled;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("console_show_errors_only"));
material::Tooltip("%s", TR("console_show_errors_only"));
}
ImGui::SameLine();
@@ -530,7 +530,7 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
s_prev_rpc_trace_enabled = s_rpc_trace_enabled;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("console_show_rpc_trace"));
material::Tooltip("%s", TR("console_show_rpc_trace"));
}
ImGui::SameLine();
@@ -547,7 +547,7 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
s_prev_app_enabled = s_app_messages_enabled;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("console_show_app_output"));
material::Tooltip("%s", TR("console_show_app_output"));
}
ImGui::SameLine();
@@ -582,7 +582,7 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
}
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", has_selection_ ? TR("console_copy_selected") : TR("console_copy_all"));
material::Tooltip("%s", has_selection_ ? TR("console_copy_selected") : TR("console_copy_all"));
}
ImGui::SameLine();
@@ -592,7 +592,7 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
show_commands_popup_ = true;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("console_show_rpc_ref"));
material::Tooltip("%s", TR("console_show_rpc_ref"));
}
ImGui::SameLine();
@@ -629,14 +629,14 @@ void ConsoleTab::renderToolbar(daemon::EmbeddedDaemon* daemon)
s_console_zoom = std::max(zoomMin, s_console_zoom - zoomStep);
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(TR("console_zoom_out"), s_console_zoom * 100.0f);
material::Tooltip(TR("console_zoom_out"), s_console_zoom * 100.0f);
}
ImGui::SameLine();
if (TactileButton(ICON_MD_ADD, ImVec2(btnSz, btnSz), Type().iconMed())) {
s_console_zoom = std::min(zoomMax, s_console_zoom + zoomStep);
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(TR("console_zoom_in"), s_console_zoom * 100.0f);
material::Tooltip(TR("console_zoom_in"), s_console_zoom * 100.0f);
}
}
}
@@ -1404,9 +1404,9 @@ void ConsoleTab::renderCommandsPopup()
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
if (cmd.params[0] != '\0')
ImGui::SetTooltip(TR("console_click_insert_params"), cmd.name, cmd.params);
material::Tooltip(TR("console_click_insert_params"), cmd.name, cmd.params);
else
ImGui::SetTooltip(TR("console_click_insert"), cmd.name);
material::Tooltip(TR("console_click_insert"), cmd.name);
}
ImGui::PopStyleColor(3);
if (showParams) {

View File

@@ -205,7 +205,7 @@ static void copyButton(const char* id, const std::string& text, float x, float y
dl->AddText(iconFont, iconFont->LegacySize,
ImVec2(x + Layout::spacingSm(), y),
hovered ? Primary() : OnSurfaceMedium(), ICON_MD_CONTENT_COPY);
if (hovered) ImGui::SetTooltip("%s", TR("click_to_copy"));
if (hovered) material::Tooltip("%s", TR("click_to_copy"));
if (clicked) {
ImGui::SetClipboardText(text.c_str());
Notifications::instance().success(TR("copied_to_clipboard"));
@@ -1066,7 +1066,7 @@ static void renderBlockDetailModal(App* app) {
if (app->rpc() && app->rpc()->isConnected())
fetchBlockDetail(app, s_detail_height - 1);
}
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Previous block");
if (ImGui::IsItemHovered()) material::Tooltip("Previous block");
ImGui::PopID();
ImGui::PopFont();
ImGui::SameLine();
@@ -1080,7 +1080,7 @@ static void renderBlockDetailModal(App* app) {
if (app->rpc() && app->rpc()->isConnected())
fetchBlockDetail(app, s_detail_height + 1);
}
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Next block");
if (ImGui::IsItemHovered()) material::Tooltip("Next block");
ImGui::PopID();
ImGui::PopFont();
}
@@ -1117,7 +1117,7 @@ static void renderBlockDetailModal(App* app) {
ImGui::GetCursorScreenPos().x, ImGui::GetCursorScreenPos().y);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", s_detail_hash.c_str());
material::Tooltip("%s", s_detail_hash.c_str());
}
ImGui::Spacing();
@@ -1218,7 +1218,7 @@ static void renderBlockDetailModal(App* app) {
WithAlpha(OnSurface(), 10),
S.drawElement("tabs.explorer", "row-rounding").size);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", txid.c_str());
material::Tooltip("%s", txid.c_str());
}
// Draw icon + text

View File

@@ -136,7 +136,7 @@ void ImportKeyDialog::render(App* app)
ImGui::SameLine();
ImGui::TextDisabled("(?)");
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("import_key_tooltip"));
material::Tooltip("%s", TR("import_key_tooltip"));
}
// Validation indicator inline with title — check preview text during hover,

View File

@@ -291,7 +291,7 @@ void RenderMarketTab(App* app)
}
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip(TR("market_trade_on"), currentExchange.name.c_str());
material::Tooltip(TR("market_trade_on"), currentExchange.name.c_str());
}
ImGui::SetCursorScreenPos(savedCur);
}
@@ -490,7 +490,7 @@ void RenderMarketTab(App* app)
s_history_initialized = false;
s_last_refresh_time = ImGui::GetTime();
}
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", TR("market_refresh_price"));
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("market_refresh_price"));
// Timestamp text to the left of refresh button
if (s_last_refresh_time > 0.0) {

View File

@@ -148,7 +148,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
}
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", idleOn ? TR("mining_idle_on_tooltip") : TR("mining_idle_off_tooltip"));
material::Tooltip("%s", idleOn ? TR("mining_idle_on_tooltip") : TR("mining_idle_off_tooltip"));
}
idleRightEdge = btnX - 4.0f * dp;
@@ -178,7 +178,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
}
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", threadScaling
material::Tooltip("%s", threadScaling
? TR("mining_idle_scale_on_tooltip")
: TR("mining_idle_scale_off_tooltip"));
}
@@ -213,7 +213,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
}
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", gpuAware
material::Tooltip("%s", gpuAware
? TR("mining_idle_gpu_on_tooltip")
: TR("mining_idle_gpu_off_tooltip"));
}
@@ -248,7 +248,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
ImGui::EndCombo();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", TR("tt_idle_delay"));
material::Tooltip("%s", TR("tt_idle_delay"));
idleRightEdge = comboX - 4.0f * dp;
}
@@ -284,7 +284,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
ImGui::EndCombo();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", TR("tt_idle_delay"));
material::Tooltip("%s", TR("tt_idle_delay"));
idleRightEdge = comboX - 4.0f * dp;
}
@@ -313,7 +313,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
ImGui::EndCombo();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", TR("mining_idle_threads_idle_tooltip"));
material::Tooltip("%s", TR("mining_idle_threads_idle_tooltip"));
idleRightEdge = comboX - 4.0f * dp;
}
@@ -352,7 +352,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
ImGui::EndCombo();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", TR("mining_idle_threads_active_tooltip"));
material::Tooltip("%s", TR("mining_idle_threads_active_tooltip"));
idleRightEdge = comboX - 4.0f * dp;
}
}
@@ -439,7 +439,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
}
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_benchmark_cancel"));
material::Tooltip("%s", TR("mining_benchmark_cancel"));
}
const char* cancelIcon = ICON_MD_CLOSE;
ImVec2 cIcoSz = icoFont->CalcTextSizeA(icoFont->LegacySize, FLT_MAX, 0, cancelIcon);
@@ -471,7 +471,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
s_benchmark.reset();
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_benchmark_dismiss"));
material::Tooltip("%s", TR("mining_benchmark_dismiss"));
}
const char* okIcon = ICON_MD_CHECK;
ImVec2 oIcoSz = icoFont->CalcTextSizeA(icoFont->LegacySize, FLT_MAX, 0, okIcon);
@@ -498,7 +498,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
dl->AddRectFilled(ImVec2(btnX, btnY), ImVec2(btnX + btnSz, btnY + btnSz),
StateHover(), btnSz * 0.5f);
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_benchmark_tooltip"));
material::Tooltip("%s", TR("mining_benchmark_tooltip"));
}
const char* benchIcon = ICON_MD_SPEED;
@@ -556,7 +556,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
minerBusy ? OnSurfaceDisabled() : OnSurfaceMedium(), xbtn);
if (xhov) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", minerBusy ? TR("xmrig_stop_mining_first")
material::Tooltip("%s", minerBusy ? TR("xmrig_stop_mining_first")
: TR("xmrig_update_title"));
}
if (xclk && !minerBusy) XmrigDownloadDialog::show(app);
@@ -864,13 +864,13 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo&
if (!disabled)
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
if (isToggling)
ImGui::SetTooltip("%s", isMiningActive ? TR("mining_stopping_tooltip") : TR("mining_starting_tooltip"));
material::Tooltip("%s", isMiningActive ? TR("mining_stopping_tooltip") : TR("mining_starting_tooltip"));
else if (isSyncing && !s_pool_mode)
ImGui::SetTooltip(TR("mining_syncing_tooltip"), state.sync.verification_progress * 100.0);
material::Tooltip(TR("mining_syncing_tooltip"), state.sync.verification_progress * 100.0);
else if (poolBlockedBySolo)
ImGui::SetTooltip("%s", TR("mining_stop_solo_for_pool"));
material::Tooltip("%s", TR("mining_stop_solo_for_pool"));
else
ImGui::SetTooltip("%s", isMiningActive ? TR("stop_mining") : TR("start_mining"));
material::Tooltip("%s", isMiningActive ? TR("stop_mining") : TR("start_mining"));
}
// Click action — pool or solo

View File

@@ -180,7 +180,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
soloMiningAvailable ? TR("mining_filter_tip_solo") : TR("mining_filter_tip_pool"),
TR("mining_filter_tip_pool")
};
ImGui::SetTooltip("%s", tips[s_earnings_filter]);
material::Tooltip("%s", tips[s_earnings_filter]);
}
ImGui::SetCursorScreenPos(savedCur);
}
@@ -287,7 +287,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
ImGui::InvisibleButton("##DiffCopy", ImVec2(diffSz.x + Layout::spacingMd(), capFont->LegacySize + 4 * dp));
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_click_copy_difficulty"));
material::Tooltip("%s", TR("mining_click_copy_difficulty"));
dl->AddLine(ImVec2(col1X + valOffX, cy + capFont->LegacySize + 1 * dp),
ImVec2(col1X + valOffX + diffSz.x, cy + capFont->LegacySize + 1 * dp),
WithAlpha(OnSurface(), 60), 1.0f * dp);
@@ -308,7 +308,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
ImGui::InvisibleButton("##BlockCopy", ImVec2(blkSz.x + Layout::spacingMd(), capFont->LegacySize + 4 * dp));
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_click_copy_block"));
material::Tooltip("%s", TR("mining_click_copy_block"));
dl->AddLine(ImVec2(col2X + valOffX, cy + capFont->LegacySize + 1 * dp),
ImVec2(col2X + valOffX + blkSz.x, cy + capFont->LegacySize + 1 * dp),
WithAlpha(OnSurface(), 60), 1.0f * dp);
@@ -346,7 +346,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
ImGui::InvisibleButton("##MiningAddrCopy", ImVec2(addrTextSz.x + Layout::spacingMd(), capFont->LegacySize + 4 * dp));
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", TR("mining_click_copy_address"));
material::Tooltip("%s", TR("mining_click_copy_address"));
dl->AddLine(ImVec2(col3X + valOffX, cy + capFont->LegacySize + 1 * dp),
ImVec2(col3X + valOffX + addrTextSz.x, cy + capFont->LegacySize + 1 * dp),
WithAlpha(OnSurface(), 60), 1.0f * dp);
@@ -518,7 +518,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
ImGui::SetCursorScreenPos(ImVec2(barX, barY));
ImGui::InvisibleButton("##rambar", ImVec2(barW, barH));
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
material::BeginTooltip();
if (selfRAM >= 1024.0)
ImGui::Text(TR("ram_wallet_gb"), selfRAM / 1024.0);
else
@@ -529,7 +529,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
ImGui::Text(TR("ram_daemon_mb"), daemonRAM, app->getDaemonMemDiag().c_str());
ImGui::Separator();
ImGui::Text(TR("ram_system_gb"), usedRAM / 1024.0, totalRAM / 1024.0);
ImGui::EndTooltip();
material::EndTooltip();
}
}
@@ -662,7 +662,7 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
dragonx::util::Platform::openUrl(url);
}
if (ImGui::IsItemHovered() && !mtx.txid.empty()) {
ImGui::SetTooltip("%s", TR("mining_open_in_explorer"));
material::Tooltip("%s", TR("mining_open_in_explorer"));
}
}

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

View File

@@ -336,7 +336,7 @@ void RenderMiningStats(const WalletState& state, const MiningInfo& mining,
if (hov) {
dl->AddCircleFilled(btnCenter, btnSize * 0.5f, StateHover());
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s", toggleTip);
material::Tooltip("%s", toggleTip);
}
dl->AddText(iconFont, iconFont->LegacySize,
ImVec2(btnCenter.x - iconSz.x * 0.5f, btnCenter.y - iconSz.y * 0.5f),

View File

@@ -352,7 +352,7 @@ void RenderPeersTab(App* app)
ImGui::InvisibleButton("##BestBlockCopy", ImVec2(hashSz.x + Layout::spacingSm(), sub1->LegacySize + 2 * dp));
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s %s", TR("peers_click_copy"), hash.c_str());
material::Tooltip("%s %s", TR("peers_click_copy"), hash.c_str());
dl->AddLine(ImVec2(cx, valY + sub1->LegacySize + 1 * dp),
ImVec2(cx + hashSz.x, valY + sub1->LegacySize + 1 * dp),
WithAlpha(OnSurface(), 60), 1.0f * dp);
@@ -657,7 +657,7 @@ void RenderPeersTab(App* app)
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
if (!isRefreshing)
ImGui::SetTooltip("%s", TR("peers_refresh_tooltip"));
material::Tooltip("%s", TR("peers_refresh_tooltip"));
}
ImGui::PopID();
}
@@ -808,7 +808,7 @@ void RenderPeersTab(App* app)
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
material::BeginTooltip();
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(8, 3));
if (ImGui::BeginTable("##PeerTT", 2, ImGuiTableFlags_SizingFixedFit)) {
auto TTRow = [](const char* label, const char* value) {
@@ -836,7 +836,7 @@ void RenderPeersTab(App* app)
ImGui::EndTable();
}
ImGui::PopStyleVar();
ImGui::EndTooltip();
material::EndTooltip();
}
if (i < state.peers.size() - 1) {

View File

@@ -274,7 +274,7 @@ static void RenderAddressDropdown(App* app, float width) {
s_cached_qr_data.clear(); // Force QR regeneration
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s\nBalance: %.8f %s%s",
material::Tooltip("%s\nBalance: %.8f %s%s",
addr.address.c_str(), addr.balance, DRAGONX_TICKER,
isCurrent ? "\n(selected)" : "");
}
@@ -842,7 +842,7 @@ void RenderReceiveTab(App* app)
ImGui::InvisibleButton("##QRClickCopy", ImVec2(totalQrSize, totalQrSize));
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
ImGui::SetTooltip("%s",
material::Tooltip("%s",
s_request_amount > 0 ? TR("click_copy_uri") : TR("click_copy_address"));
}
if (ImGui::IsItemClicked()) {

View File

@@ -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);

View File

@@ -221,7 +221,7 @@ void RenderSettingsWindow(App* app, bool* p_open)
ImGui::EndDisabled();
ImGui::PopStyleColor();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
ImGui::SetTooltip("%s", skin.validationError.c_str());
material::Tooltip("%s", skin.validationError.c_str());
}
} else {
std::string label = skin.name;
@@ -244,7 +244,7 @@ void RenderSettingsWindow(App* app, bool* p_open)
ImGui::EndCombo();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", TR("tt_theme_hotkey"));
material::Tooltip("%s", TR("tt_theme_hotkey"));
// Show indicator if custom theme is active
if (active_is_custom) {
@@ -253,7 +253,7 @@ void RenderSettingsWindow(App* app, bool* p_open)
ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f), ICON_CUSTOM_THEME);
ImGui::PopFont();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s", TR("tt_custom_theme"));
material::Tooltip("%s", TR("tt_custom_theme"));
}
}
@@ -265,7 +265,7 @@ void RenderSettingsWindow(App* app, bool* p_open)
}
ImGui::PopFont();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(TR("tt_scan_themes"),
material::Tooltip(TR("tt_scan_themes"),
schema::SkinManager::getUserSkinsDirectory().c_str());
}

View File

@@ -842,7 +842,7 @@ void RenderTransactionsTab(App* app)
// Tooltip
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s\n%s\n%s", tx.address.c_str(),
material::Tooltip("%s\n%s\n%s", tx.address.c_str(),
tx.txid.c_str(), tx.getTimeString().c_str());
}