1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Extract small color box drawing.

This commit is contained in:
Bartosz Taudul
2019-09-11 18:38:10 +02:00
parent 00409b0b94
commit 4ea62ecb06
2 changed files with 11 additions and 8 deletions
+2 -8
View File
@@ -5203,10 +5203,7 @@ void View::DrawZoneInfoWindow()
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, tid, GetZoneDepth( ev, tid ) );
ImGui::ColorButton( "c1", ImVec4( (col & 0xFF) / 255.f, ((col>>8) & 0xFF ) / 255.f, ((col>>16) & 0xFF ) / 255.f, 1.f ), ImGuiColorEditFlags_NoTooltip );
ImGui::PopStyleVar();
SmallColorBox( GetRawZoneColor( ev, tid, GetZoneDepth( ev, tid ) ) );
TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
ImGui::SameLine();
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
@@ -5969,10 +5966,7 @@ void View::DrawGpuInfoWindow()
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();
SmallColorBox( GetRawZoneColor( ev ) );
TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
ImGui::SameLine();
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );