From 04cb7732b8083ffa54ea1d8011b59686f657b73b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 2 Nov 2019 22:58:50 +0100 Subject: [PATCH] Add zone color boxes to compare menu. --- server/TracyView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d442e9cd..f897a915 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -9229,8 +9229,12 @@ void View::DrawCompare() { auto& srcloc = m_worker.GetSourceLocation( v ); auto& zones = m_worker.GetZonesForSourceLocation( v ).zones; + SmallColorBox( GetSrcLocColor( srcloc, 0 ) ); + ImGui::SameLine(); ImGui::PushID( idx ); + ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); ImGui::RadioButton( m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function ), &m_compare.selMatch[0], idx++ ); + ImGui::PopStyleVar(); ImGui::SameLine(); ImGui::TextColored( ImVec4( 0.5, 0.5, 0.5, 1 ), "(%s) %s:%i", RealToString( zones.size(), true ), m_worker.GetString( srcloc.file ), srcloc.line ); ImGui::PopID(); @@ -9244,7 +9248,9 @@ void View::DrawCompare() auto& srcloc = m_compare.second->GetSourceLocation( v ); auto& zones = m_compare.second->GetZonesForSourceLocation( v ).zones; ImGui::PushID( -1 - idx ); + ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); ImGui::RadioButton( m_compare.second->GetString( srcloc.name.active ? srcloc.name : srcloc.function ), &m_compare.selMatch[1], idx++ ); + ImGui::PopStyleVar(); ImGui::SameLine(); ImGui::TextColored( ImVec4( 0.5, 0.5, 0.5, 1 ), "(%s) %s:%i", RealToString( zones.size(), true ), m_compare.second->GetString( srcloc.file ), srcloc.line ); ImGui::PopID();