Skip to content

Commit

Permalink
Improved readability of the console window, especially errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DVLP committed Mar 8, 2024
1 parent c1b5363 commit 4452a0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/overlay/widgets/LogWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4452a0e

Please sign in to comment.