From c9a1d3d7e50c8664c90af0542c66108e69b3c818 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 8 Sep 2019 13:19:43 +0200 Subject: [PATCH] Display zone color in zone info window. --- server/TracyView.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 15752152..f9616c12 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5202,6 +5202,11 @@ void View::DrawZoneInfoWindow() TextDisabledUnformatted( "Location:" ); ImGui::SameLine(); ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); + ImGui::SameLine(); + ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); + const auto col = GetRawZoneColor( ev ); + ImGui::ColorButton( "c1", ImVec4( (col & 0xFF) / 255.f, ((col>>8) & 0xFF ) / 255.f, ((col>>16) & 0xFF ) / 255.f, 1.f ), ImGuiColorEditFlags_NoTooltip ); + ImGui::PopStyleVar(); TextFocused( "Thread:", m_worker.GetThreadName( tid ) ); ImGui::SameLine(); ImGui::TextDisabled( "(%s)", RealToString( tid, true ) ); @@ -5963,6 +5968,11 @@ void View::DrawGpuInfoWindow() TextDisabledUnformatted( "Location:" ); ImGui::SameLine(); ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); + ImGui::SameLine(); + ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); + const auto col = GetRawZoneColor( ev ); + ImGui::ColorButton( "c1", ImVec4( (col & 0xFF) / 255.f, ((col>>8) & 0xFF ) / 255.f, ((col>>16) & 0xFF ) / 255.f, 1.f ), ImGuiColorEditFlags_NoTooltip ); + ImGui::PopStyleVar(); TextFocused( "Thread:", m_worker.GetThreadName( tid ) ); ImGui::SameLine(); ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );