MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / TextURL

Function TextURL

KBotExt/Misc.h:444–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442 }
443
444 static void TextURL(const char* name, const char* url, uint8_t sameLineBefore = 1, uint8_t sameLineAfter = 1)
445 {
446 if (1 == sameLineBefore) { SameLine(0.0f, GetStyle().ItemInnerSpacing.x); }
447 PushStyleColor(ImGuiCol_Text, GetStyle().Colors[ImGuiCol_ButtonHovered]);
448 Text(name); // PotentiallyInsecureFormatSecurity
449 PopStyleColor();
450 if (IsItemHovered())
451 {
452 if (IsMouseClicked(0))
453 {
454 Utils::OpenUrl(url, nullptr, SW_SHOWNORMAL);
455 }
456 AddUnderLine(GetStyle().Colors[ImGuiCol_ButtonHovered]);
457 SetTooltip(" Open in browser\n%s", url);
458 }
459 else
460 {
461 AddUnderLine(GetStyle().Colors[ImGuiCol_Button]);
462 }
463 if (1 == sameLineAfter) { SameLine(0.0f, GetStyle().ItemInnerSpacing.x); }
464 }
465
466#pragma warning( push )
467#pragma warning( disable : 4996 )

Callers 2

CustomMethod · 0.85
RenderMethod · 0.85

Calls 1

AddUnderLineFunction · 0.85

Tested by

no test coverage detected