Always display statistics mode selection.

Even if only one option is available.
This commit is contained in:
Bartosz Taudul 2021-09-23 18:32:59 +02:00
parent f74818ece5
commit 4c220bdc14
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -12323,29 +12323,23 @@ void View::DrawStatistics()
}
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 2, 2 ) );
if( m_worker.AreCallstackSamplesReady() )
{
const auto hasSamples = m_worker.GetCallstackSampleCount() > 0;
const auto hasSymbols = m_worker.GetSymbolsCount() > 0;
if( hasSamples || hasSymbols )
{
ImGui::RadioButton( ICON_FA_SYRINGE " Instrumentation", &m_statMode, 0 );
ImGui::SameLine();
if( hasSamples )
if( m_worker.AreCallstackSamplesReady() )
{
if( m_worker.GetCallstackSampleCount() > 0 )
{
ImGui::Spacing();
ImGui::SameLine();
ImGui::RadioButton( ICON_FA_EYE_DROPPER " Sampling", &m_statMode, 1 );
}
else
else if( m_worker.GetSymbolsCount() > 0 )
{
ImGui::Spacing();
ImGui::SameLine();
ImGui::RadioButton( ICON_FA_PUZZLE_PIECE " Symbols", &m_statMode, 1 );
}
}
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
@ -12353,8 +12347,7 @@ void View::DrawStatistics()
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
}
}
Vector<SrcLocZonesSlim> srcloc;