Only display "go to parent" if there is a parent.

This commit is contained in:
Bartosz Taudul 2018-08-18 02:12:34 +02:00
parent 91c397f25c
commit 0757930521

View File

@ -3461,15 +3461,15 @@ void View::DrawZoneInfoWindow()
{
ZoomToZone( ev );
}
auto parent = GetZoneParent( ev );
if( parent )
{
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_ARROW_UP " Go to parent" ) )
#else
if( ImGui::Button( "Go to parent" ) )
#endif
{
auto parent = GetZoneParent( ev );
if( parent )
{
ShowZoneInfo( *parent );
}
@ -3693,7 +3693,6 @@ void View::DrawZoneInfoWindow()
ImGui::Separator();
std::vector<const ZoneEvent*> zoneTrace;
auto parent = GetZoneParent( ev );
while( parent )
{
zoneTrace.emplace_back( parent );
@ -3811,15 +3810,15 @@ void View::DrawGpuInfoWindow()
{
ZoomToZone( ev );
}
auto parent = GetZoneParent( ev );
if( parent )
{
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_ARROW_UP " Go to parent" ) )
#else
if( ImGui::Button( "Go to parent" ) )
#endif
{
auto parent = GetZoneParent( ev );
if( parent )
{
ShowZoneInfo( *parent, m_gpuInfoWindowThread );
}
@ -3924,7 +3923,6 @@ void View::DrawGpuInfoWindow()
ImGui::Separator();
std::vector<const GpuEvent*> zoneTrace;
auto parent = GetZoneParent( ev );
while( parent )
{
zoneTrace.emplace_back( parent );