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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user