1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-08 16:03:53 +00:00

Display zone color in zone info window.

This commit is contained in:
Bartosz Taudul 2019-09-08 13:19:43 +02:00
parent b7522ec4c1
commit c9a1d3d7e5

View File

@ -5202,6 +5202,11 @@ void View::DrawZoneInfoWindow()
TextDisabledUnformatted( "Location:" ); TextDisabledUnformatted( "Location:" );
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); 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 ) ); TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) ); ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
@ -5963,6 +5968,11 @@ void View::DrawGpuInfoWindow()
TextDisabledUnformatted( "Location:" ); TextDisabledUnformatted( "Location:" );
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); 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 ) ); TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) ); ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );