From 4452a0e9710fc31536c3dedeb67982b5132a0bfa Mon Sep 17 00:00:00 2001 From: Pawel Date: Fri, 8 Mar 2024 02:35:44 +0000 Subject: [PATCH] Improved readability of the console window, especially errors Currently red on blue errors are almost unreadable in the console. This PR changes the background of the console content to semi-transparent black and changes the the error color to a slightly brighter shade of red. --- src/overlay/widgets/LogWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/overlay/widgets/LogWindow.cpp b/src/overlay/widgets/LogWindow.cpp index 08cc098f..403aa0c6 100644 --- a/src/overlay/widgets/LogWindow.cpp +++ b/src/overlay/widgets/LogWindow.cpp @@ -29,6 +29,7 @@ void LogWindow::Draw(const ImVec2& size) const auto& style = ImGui::GetStyle(); const auto frameId = ImGui::GetID(("##" + m_loggerName).c_str()); + ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0f, 0, 0, 0.5f)); if (ImGui::BeginChildFrame(frameId, size, ImGuiWindowFlags_HorizontalScrollbar)) { std::lock_guard _{m_lock}; @@ -61,7 +62,7 @@ void LogWindow::Draw(const ImVec2& size) case spdlog::level::level_enum::warn: ImGui::PushStyleColor(ImGuiCol_Text, ImVec4{1.0f, 1.0f, 0.0f, 1.0f}); break; case spdlog::level::level_enum::err: - case spdlog::level::level_enum::critical: ImGui::PushStyleColor(ImGuiCol_Text, ImVec4{1.0f, 0.0f, 0.0f, 1.0f}); break; + case spdlog::level::level_enum::critical: ImGui::PushStyleColor(ImGuiCol_Text, ImVec4{1.0f, 0.1f, 0.2f, 1.0f}); break; case spdlog::level::level_enum::info: default: ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_Text)); @@ -95,6 +96,7 @@ void LogWindow::Draw(const ImVec2& size) } } ImGui::EndChildFrame(); + ImGui::PopStyleColor(1); // pop ImGuiCol_FrameBg } void LogWindow::Log(const std::string& acpText)