1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Improve "no data" screens in statistics window.

This commit is contained in:
Bartosz Taudul
2024-09-28 01:39:49 +02:00
parent a34b058701
commit d734aaa357
+11 -2
View File
@@ -46,7 +46,12 @@ void View::DrawStatistics()
#else #else
if( !m_worker.AreSourceLocationZonesReady() && ( !m_worker.AreCallstackSamplesReady() || m_worker.GetCallstackSampleCount() == 0 ) ) if( !m_worker.AreSourceLocationZonesReady() && ( !m_worker.AreCallstackSamplesReady() || m_worker.GetCallstackSampleCount() == 0 ) )
{ {
ImGui::TextWrapped( "Please wait, computing data..." ); const auto ty = ImGui::GetTextLineHeight();
ImGui::PushFont( m_bigFont );
ImGui::Dummy( ImVec2( 0, ( ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeight() * 2 - ty ) * 0.5f ) );
TextCentered( ICON_FA_HIPPO );
TextCentered( "Please wait, computing data..." );
ImGui::PopFont();
DrawWaitingDots( s_time ); DrawWaitingDots( s_time );
ImGui::End(); ImGui::End();
return; return;
@@ -589,7 +594,11 @@ void View::DrawStatistics()
{ {
if( srcloc.empty() ) if( srcloc.empty() )
{ {
ImGui::TextUnformatted( "No entries to be displayed." ); ImGui::PushFont( m_bigFont );
ImGui::Dummy( ImVec2( 0, ( ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeight() * 2 ) * 0.5f ) );
TextCentered( ICON_FA_HIPPO );
TextCentered( "No entries to be displayed" );
ImGui::PopFont();
} }
else else
{ {