Refactor ClickableText function to use tab colors for improved visual consistency; add TODO for theme setup
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user