Display custom zone name in find zone results list.

This commit is contained in:
Bartosz Taudul 2018-06-29 16:20:24 +02:00
parent ab18869ce6
commit 275a79e1c9

View File

@ -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();
}