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

Aesthetic fixes to accumulation mode combo box

Shorter text fields and more spacing.
This commit is contained in:
Terence Rokop 2021-06-26 10:40:28 -07:00
parent 1dd117533e
commit e105d2d96c
No known key found for this signature in database
GPG Key ID: FB9F472D903AD4FD

View File

@ -12273,10 +12273,13 @@ struct SrcLocZonesSlim
void View::AccumulationModeComboBox() void View::AccumulationModeComboBox()
{ {
ImGui::TextUnformatted( "Accumulation mode" );
ImGui::SameLine(); ImGui::SameLine();
const char* accumulationModeTable = m_statMode == 0 ? "Self only\0Including children\0Non-reentrant\0" : "Self only\0Including children\0"; ImGui::Spacing();
ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Including children" ).x + ImGui::GetTextLineHeight() * 2 ); ImGui::SameLine();
ImGui::TextUnformatted( "Timing" );
ImGui::SameLine();
const char* accumulationModeTable = m_statMode == 0 ? "Self only\0With children\0Non-reentrant\0" : "Self only\0With children\0";
ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Non-reentrant" ).x + ImGui::GetTextLineHeight() * 2 );
if ( m_statMode != 0 && m_statAccumulationMode == AccumulationMode::NonReentrantChildren ) if ( m_statMode != 0 && m_statAccumulationMode == AccumulationMode::NonReentrantChildren )
{ {
m_statAccumulationMode = AccumulationMode::SelfOnly; m_statAccumulationMode = AccumulationMode::SelfOnly;
@ -12284,6 +12287,9 @@ void View::AccumulationModeComboBox()
int accumulationMode = static_cast<int>( m_statAccumulationMode ); int accumulationMode = static_cast<int>( m_statAccumulationMode );
ImGui::Combo( "##accumulationMode", &accumulationMode, accumulationModeTable ); ImGui::Combo( "##accumulationMode", &accumulationMode, accumulationModeTable );
m_statAccumulationMode = static_cast<AccumulationMode>( accumulationMode ); m_statAccumulationMode = static_cast<AccumulationMode>( accumulationMode );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
} }
void View::DrawStatistics() void View::DrawStatistics()
@ -12499,9 +12505,6 @@ void View::DrawStatistics()
ImGui::Spacing(); ImGui::Spacing();
ImGui::SameLine(); ImGui::SameLine();
TextFocused( "Visible zones:", RealToString( srcloc.size() ) ); TextFocused( "Visible zones:", RealToString( srcloc.size() ) );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
AccumulationModeComboBox(); AccumulationModeComboBox();
} }
else else