1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Replace tabs with radio buttons.

This commit is contained in:
Bartosz Taudul 2020-02-27 12:24:28 +01:00
parent 8173f24515
commit 374ddbe2a6
2 changed files with 177 additions and 177 deletions

View File

@ -10946,15 +10946,25 @@ void View::DrawStatistics()
return;
}
bool instrumentationTab = true;
const auto hasSampleData = m_worker.AreCallstackSamplesReady() && m_worker.GetCallstackSampleCount() > 0;
if( hasSampleData )
if( m_worker.AreCallstackSamplesReady() && m_worker.GetCallstackSampleCount() > 0 )
{
ImGui::BeginTabBar( "StatisticsTabBar" );
instrumentationTab = ImGui::BeginTabItem( "Instrumentation" );
#ifdef TRACY_EXTENDED_FONT
ImGui::RadioButton( ICON_FA_SYRINGE " Instrumentation", &m_statMode, 0 );
#else
ImGui::RadioButton( "Instrumentation", &m_statMode, 0 );
#endif
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
ImGui::RadioButton( ICON_FA_EYE_DROPPER " Sampling", &m_statMode, 1 );
#else
ImGui::RadioButton( "Sampling", &m_statMode, 1 );
#endif
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
}
if( instrumentationTab )
if( m_statMode == 0 )
{
#ifdef TRACY_EXTENDED_FONT
m_statisticsFilter.Draw( ICON_FA_FILTER " Filter zones", 200 );
@ -11120,16 +11130,8 @@ void View::DrawStatistics()
}
ImGui::EndColumns();
ImGui::EndChild();
if( hasSampleData )
{
ImGui::EndTabItem();
}
}
if( hasSampleData )
{
if( ImGui::BeginTabItem( "Sampling" ) )
else
{
#ifdef TRACY_EXTENDED_FONT
m_statisticsFilter.Draw( ICON_FA_FILTER " Filter zones", 200 );
@ -11292,9 +11294,6 @@ void View::DrawStatistics()
}
ImGui::EndColumns();
ImGui::EndChild();
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
#endif
ImGui::End();

View File

@ -344,6 +344,7 @@ private:
int m_statSort = 0;
bool m_statSelf = false;
bool m_statSampleTime = true;
int m_statMode = 0;
int m_showCallstackFrameAddress = 0;
bool m_showUnknownFrames = true;
bool m_groupChildrenLocations = false;