1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 04:43:53 +00:00

Hide frame related information if no frame instrumentation.

This commit is contained in:
Bartosz Taudul 2022-09-05 20:12:36 +02:00
parent 23ebce2862
commit 5200ea2c84
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
4 changed files with 84 additions and 75 deletions

View File

@ -836,6 +836,8 @@ bool View::DrawImpl()
ImGui::EndPopup(); ImGui::EndPopup();
} }
} }
if( m_worker.AreFramesUsed() )
{
ImGui::SameLine(); ImGui::SameLine();
if( ImGui::SmallButton( " " ICON_FA_CARET_LEFT " " ) ) ZoomToPrevFrame(); if( ImGui::SmallButton( " " ICON_FA_CARET_LEFT " " ) ) ZoomToPrevFrame();
ImGui::SameLine(); ImGui::SameLine();
@ -886,6 +888,7 @@ bool View::DrawImpl()
if( clicked ) ZoomToRange( m_worker.GetFrameBegin( *m_frames, frameNum - frameOffset ), m_worker.GetFrameEnd( *m_frames, frameNum - frameOffset ) ); if( clicked ) ZoomToRange( m_worker.GetFrameBegin( *m_frames, frameNum - frameOffset ), m_worker.GetFrameEnd( *m_frames, frameNum - frameOffset ) );
ImGui::EndPopup(); ImGui::EndPopup();
} }
}
{ {
ImGui::SameLine(); ImGui::SameLine();

View File

@ -696,6 +696,8 @@ void View::DrawOptions()
ImGui::TreePop(); ImGui::TreePop();
} }
if( m_worker.AreFramesUsed() )
{
ImGui::Separator(); ImGui::Separator();
expand = ImGui::TreeNode( ICON_FA_IMAGES " Visible frame sets:" ); expand = ImGui::TreeNode( ICON_FA_IMAGES " Visible frame sets:" );
ImGui::SameLine(); ImGui::SameLine();
@ -730,6 +732,7 @@ void View::DrawOptions()
} }
ImGui::TreePop(); ImGui::TreePop();
} }
}
ImGui::End(); ImGui::End();
} }

View File

@ -296,6 +296,8 @@ void View::DrawTimeline()
m_tc.Begin(); m_tc.Begin();
DrawTimelineFramesHeader(); DrawTimelineFramesHeader();
if( m_worker.AreFramesUsed() )
{
auto& frames = m_worker.GetFrames(); auto& frames = m_worker.GetFrames();
for( auto fd : frames ) for( auto fd : frames )
{ {
@ -304,6 +306,7 @@ void View::DrawTimeline()
DrawTimelineFrames( *fd ); DrawTimelineFrames( *fd );
} }
} }
}
const auto yMin = ImGui::GetCursorScreenPos().y; const auto yMin = ImGui::GetCursorScreenPos().y;
const auto yMax = linepos.y + lineh; const auto yMax = linepos.y + lineh;

View File

@ -183,7 +183,7 @@ void View::DrawInfo()
ImGui::TreePop(); ImGui::TreePop();
} }
if( ImGui::TreeNode( "Frame statistics" ) ) if( m_worker.AreFramesUsed() && ImGui::TreeNode( "Frame statistics" ) )
{ {
auto fsz = m_worker.GetFullFrameCount( *m_frames ); auto fsz = m_worker.GetFullFrameCount( *m_frames );
if( fsz != 0 ) if( fsz != 0 )