| 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 ) |
no test coverage detected