Refactor ClickableText function to use tab colors for improved visual consistency; add TODO for theme setup

This commit is contained in:
scawful
2025-03-11 21:05:32 -04:00
parent 61e35f2819
commit 57dd640c3a

View File

@@ -188,13 +188,14 @@ void Paragraph(const std::string& text) {
ImGui::TextWrapped("%s", text.c_str()); ImGui::TextWrapped("%s", text.c_str());
} }
// TODO: Setup themes and text/clickable colors
bool ClickableText(const std::string& text) { bool ClickableText(const std::string& text) {
static auto color = ImGui::GetStyleColorVec4(ImGuiCol_Text); static auto color = ImGui::GetStyleColorVec4(ImGuiCol_Tab);
ImGui::TextColored(color, "%s", text.c_str()); ImGui::TextColored(color, "%s", text.c_str());
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
color = ImGui::GetStyleColorVec4(ImGuiCol_TabHovered); color = ImGui::GetStyleColorVec4(ImGuiCol_TabHovered);
} else { } else {
color = ImGui::GetStyleColorVec4(ImGuiCol_Text); color = ImGui::GetStyleColorVec4(ImGuiCol_Tab);
} }
return ImGui::IsItemClicked(); return ImGui::IsItemClicked();
} }