Only display zone "statistics" button if data is available.

This commit is contained in:
Bartosz Taudul 2020-01-23 19:49:23 +01:00
parent f4fdd0221b
commit 443771ecff

View File

@ -5707,15 +5707,25 @@ void View::DrawZoneInfoWindow()
ShowZoneInfo( *parent );
}
}
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_CHART_BAR " Statistics" ) )
#else
if( ImGui::Button( "Statistics" ) )
#endif
#ifndef TRACY_NO_STATISTICS
if( m_worker.AreSourceLocationZonesReady() )
{
m_findZone.ShowZone( ev.SrcLoc(), m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function ) );
const auto sl = ev.SrcLoc();
const auto& slz = m_worker.GetZonesForSourceLocation( sl );
if( !slz.zones.empty() )
{
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_CHART_BAR " Statistics" ) )
#else
if( ImGui::Button( "Statistics" ) )
#endif
{
m_findZone.ShowZone( sl, m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function ) );
}
}
}
#endif
if( ev.callstack.Val() != 0 )
{
ImGui::SameLine();