Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved readability of the console window, especially errors #935

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
DVLP committed Mar 8, 2024
commit 4452a0e9710fc31536c3dedeb67982b5132a0bfa
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
Loading