From 2f94b44a6cc2600470b1074215b088f9b0fe7299 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 3 Aug 2020 17:08:47 +0200 Subject: [PATCH] Move filter UI to a separate line in statistics menu. --- server/TracyView.cpp | 45 ++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8ecfb29f..bee6c365 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11606,6 +11606,10 @@ void View::DrawStatistics() ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); + ImGui::SeparatorEx( ImGuiSeparatorFlags_Vertical ); + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); } } @@ -11621,13 +11625,6 @@ void View::DrawStatistics() return; } - m_statisticsFilter.Draw( ICON_FA_FILTER, 200 ); - ImGui::SameLine(); - if( ImGui::Button( ICON_FA_BACKSPACE " Clear" ) ) - { - m_statisticsFilter.Clear(); - } - const auto filterActive = m_statisticsFilter.IsActive(); auto& slz = m_worker.GetSourceLocationZones(); Vector srcloc; @@ -11684,9 +11681,6 @@ void View::DrawStatistics() break; } - ImGui::SameLine(); - ImGui::Spacing(); - ImGui::SameLine(); TextFocused( "Total zone count:", RealToString( slzcnt ) ); ImGui::SameLine(); ImGui::Spacing(); @@ -11697,6 +11691,16 @@ void View::DrawStatistics() ImGui::SameLine(); ImGui::Checkbox( ICON_FA_CLOCK " Self time", &m_statSelf ); + ImGui::Separator(); + TextDisabledUnformatted( "Filter results" ); + ImGui::SameLine(); + m_statisticsFilter.Draw( ICON_FA_FILTER, 200 ); + ImGui::SameLine(); + if( ImGui::Button( ICON_FA_BACKSPACE " Clear" ) ) + { + m_statisticsFilter.Clear(); + } + ImGui::Separator(); if( srcloc.empty() ) @@ -11782,7 +11786,6 @@ void View::DrawStatistics() ImGui::NextColumn(); ImGui::TextUnformatted( TimeToString( ( m_statSelf ? v->second.selfTotal : v->second.total ) / v->second.zones.size() ) ); ImGui::NextColumn(); - ImGui::PopID(); } ImGui::EndColumns(); @@ -11791,15 +11794,6 @@ void View::DrawStatistics() } else { - m_statisticsFilter.Draw( ICON_FA_FILTER, 200 ); - ImGui::SameLine(); - if( ImGui::Button( ICON_FA_BACKSPACE " Clear" ) ) - { - m_statisticsFilter.Clear(); - } - ImGui::SameLine(); - ImGui::Spacing(); - ImGui::SameLine(); ImGui::Checkbox( ICON_FA_STOPWATCH " Show time", &m_statSampleTime ); ImGui::SameLine(); ImGui::Checkbox( ICON_FA_CLOCK " Self time", &m_statSelf ); @@ -11817,6 +11811,17 @@ void View::DrawStatistics() const char* locationTable = "Entry\0Sample\0Smart\0"; ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Sample" ).x + ImGui::GetTextLineHeight() * 2 ); ImGui::Combo( "##location", &m_statSampleLocation, locationTable ); + + ImGui::Separator(); + TextDisabledUnformatted( "Filter results" ); + ImGui::SameLine(); + m_statisticsFilter.Draw( ICON_FA_FILTER, 200 ); + ImGui::SameLine(); + if( ImGui::Button( ICON_FA_BACKSPACE " Clear" ) ) + { + m_statisticsFilter.Clear(); + } + ImGui::Separator(); const auto& symMap = m_worker.GetSymbolMap();