1
0
mirror of synced 2024-09-24 03:28:24 +02:00

impr: Remove underline from hyperlinks if they're not hovered

This commit is contained in:
WerWolv 2024-04-29 20:06:50 +02:00
parent f847807df5
commit 0e58204501

View File

@ -180,7 +180,10 @@ namespace ImGuiExt {
PushStyleColor(ImGuiCol_Text, ImU32(col));
Text("%s %s", icon, label);
GetWindowDrawList()->AddLine(ImVec2(pos.x, pos.y + size.y), pos + size, ImU32(col));
if (hovered)
GetWindowDrawList()->AddLine(ImVec2(pos.x, pos.y + size.y), pos + size, ImU32(col));
PopStyleColor();
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
@ -209,7 +212,10 @@ namespace ImGuiExt {
const ImU32 col = hovered ? GetColorU32(ImGuiCol_ButtonHovered) : GetColorU32(ImGuiCol_ButtonActive);
PushStyleColor(ImGuiCol_Text, ImU32(col));
TextEx(label, nullptr, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting
GetWindowDrawList()->AddLine(ImVec2(pos.x, pos.y + size.y), pos + size, ImU32(col));
if (hovered)
GetWindowDrawList()->AddLine(ImVec2(pos.x, pos.y + size.y), pos + size, ImU32(col));
PopStyleColor();
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);