1
0
mirror of synced 2025-02-20 04:01:01 +01:00

impr: Make hyperlink icons gray

This commit is contained in:
WerWolv 2025-02-16 14:30:06 +01:00
parent a907550567
commit f6e3ede178
2 changed files with 9 additions and 4 deletions

View File

@ -330,16 +330,21 @@ namespace ImGuiExt {
bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
BeginGroup();
TextDisabled("%s", icon);
SameLine();
const ImU32 col = hovered ? GetColorU32(ImGuiCol_ButtonHovered) : GetColorU32(ImGuiCol_ButtonActive);
PushStyleColor(ImGuiCol_Text, ImU32(col));
Text("%s %s", icon, label);
TextUnformatted(label);
if (hovered)
GetWindowDrawList()->AddLine(ImVec2(pos.x, pos.y + size.y), pos + size, ImU32(col));
PopStyleColor();
EndGroup();
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
return pressed;
}

View File

@ -280,7 +280,7 @@ namespace hex::plugin::builtin::recent {
icon = ICON_VS_FILE_BINARY;
}
if (ImGuiExt::Hyperlink(hex::format("{} {}", icon, hex::limitStringLength(recentEntry.displayName, 32)).c_str())) {
if (ImGuiExt::IconHyperlink(icon, hex::limitStringLength(recentEntry.displayName, 32).c_str())) {
loadRecentEntry(recentEntry);
break;
}
@ -341,7 +341,7 @@ namespace hex::plugin::builtin::recent {
if (s_autoBackupsFound) {
ImGui::Separator();
if (ImGuiExt::Hyperlink(hex::format("{} {}", ICON_VS_ARCHIVE, "hex.builtin.welcome.start.recent.auto_backups"_lang).c_str()))
if (ImGuiExt::IconHyperlink(ICON_VS_ARCHIVE, "hex.builtin.welcome.start.recent.auto_backups"_lang))
PopupAutoBackups::open();
}
}