From 275a79e1c9258b0e0c3d2cdfdd4781b21467afbc Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 29 Jun 2018 16:20:24 +0200 Subject: [PATCH] Display custom zone name in find zone results list. --- server/TracyView.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index cafbcf7a..9e7a443d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4181,12 +4181,22 @@ void View::DrawFindZone() if( expand ) { - ImGui::Columns( 2, hdrString ); + ImGui::Columns( 3, hdrString ); ImGui::Separator(); ImGui::Text( "Time from start" ); ImGui::NextColumn(); ImGui::Text( "Execution time" ); ImGui::NextColumn(); + ImGui::Text( "Name" ); + ImGui::SameLine(); + ImGui::TextDisabled( "(?)" ); + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + ImGui::Text( "Only displayed if custom zone name is set." ); + ImGui::EndTooltip(); + } + ImGui::NextColumn(); ImGui::Separator(); for( auto& ev : v->second ) @@ -4195,8 +4205,6 @@ void View::DrawFindZone() const auto timespan = end - ev->start; ImGui::PushID( ev ); - - auto& srcloc = m_worker.GetSourceLocation( ev->srcloc ); if( ImGui::Selectable( TimeToString( ev->start - m_worker.GetFrameBegin( 0 ) ), m_zoneInfoWindow == ev, ImGuiSelectableFlags_SpanAllColumns ) ) { ShowZoneInfo( *ev ); @@ -4214,6 +4222,11 @@ void View::DrawFindZone() ImGui::NextColumn(); ImGui::Text( "%s", TimeToString( timespan ) ); ImGui::NextColumn(); + if( ev->name.active ) + { + ImGui::Text( "%s", m_worker.GetString( ev->name ) ); + } + ImGui::NextColumn(); ImGui::PopID(); }