diff --git a/server/TracyView.hpp b/server/TracyView.hpp index f27bf654..654134a7 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -457,6 +457,7 @@ private: ImGuiTextFilter m_statisticsFilter; ImGuiTextFilter m_statisticsImageFilter; + ImGuiTextFilter m_userTextFilter; Region m_highlight; Region m_highlightZoom; diff --git a/server/TracyView_FindZone.cpp b/server/TracyView_FindZone.cpp index 7de5f561..b6592d4d 100644 --- a/server/TracyView_FindZone.cpp +++ b/server/TracyView_FindZone.cpp @@ -1362,6 +1362,23 @@ void View::DrawFindZone() SmallCheckbox( "Show zone time in frames", &m_findZone.showZoneInFrames ); ImGui::Separator(); + ImGui::AlignTextToFramePadding(); + TextDisabledUnformatted( "Filter user text:" ); + ImGui::SameLine(); + bool filterChanged = m_userTextFilter.Draw( ICON_FA_FILTER "###resultFilter", 200 ); + + ImGui::SameLine(); + if( ImGui::Button( ICON_FA_DELETE_LEFT " Clear" ) ) + { + m_userTextFilter.Clear(); + filterChanged = true; + } + ImGui::Separator(); + if( filterChanged ) + { + m_findZone.ResetGroups(); + } + ImGui::TextUnformatted( "Found zones:" ); ImGui::SameLine(); DrawHelpMarker( "Left click to highlight entry." ); @@ -1429,6 +1446,25 @@ void View::DrawFindZone() zptr++; continue; } + + if( m_userTextFilter.IsActive() ) + { + bool keep = false; + if ( m_worker.HasZoneExtra( *ev.Zone() ) && m_worker.GetZoneExtra( *ev.Zone() ).text.Active() ) + { + auto text = m_worker.GetString( m_worker.GetZoneExtra( *ev.Zone() ).text ); + if( m_userTextFilter.PassFilter( text ) ) + { + keep = true; + } + } + if( !keep ) + { + zptr++; + continue; + } + } + auto timespan = end - start; assert( timespan != 0 ); if( m_findZone.selfTime )