diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 0c26a815..413886dd 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -10486,7 +10486,16 @@ void View::DrawFindZone() ImGui::Separator(); ImGui::TextUnformatted( "Found zones:" ); ImGui::SameLine(); - DrawHelpMarker( "Left click to highlight entry. Right click to clear selection." ); + DrawHelpMarker( "Left click to highlight entry." ); + if( m_findZone.selGroup != m_findZone.Unselected ) + { + ImGui::SameLine(); + if( ImGui::SmallButton( ICON_FA_BACKSPACE " Clear" ) ) + { + m_findZone.selGroup = m_findZone.Unselected; + m_findZone.ResetSelection(); + } + } bool groupChanged = false; ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); @@ -10660,7 +10669,6 @@ void View::DrawFindZone() break; } - ImGui::BeginChild( "##zonesScroll", ImVec2( ImGui::GetWindowContentRegionWidth(), std::max( 200.f, ImGui::GetContentRegionAvail().y ) ) ); if( groupBy == FindZone::GroupBy::Callstack ) { const auto gsz = (int)groups.size(); @@ -10764,7 +10772,7 @@ void View::DrawFindZone() ImGui::Spacing(); if( ImGui::TreeNodeEx( "Zone list" ) ) { - DrawZoneList( group->second.zones ); + DrawZoneList( group->second.id, group->second.zones ); } } } @@ -10844,26 +10852,23 @@ void View::DrawFindZone() ImGui::TextColored( ImVec4( 0.5f, 0.5f, 0.5f, 1.0f ), "(%s) %s", RealToString( v->second.zones.size() ), TimeToString( v->second.time ) ); if( expand ) { - DrawZoneList( v->second.zones ); + DrawZoneList( v->second.id, v->second.zones ); } } } ImGui::EndChild(); - if( ImGui::IsItemHovered() && IsMouseClicked( 1 ) ) - { - m_findZone.selGroup = m_findZone.Unselected; - m_findZone.ResetSelection(); - } - ImGui::EndChild(); } #endif ImGui::End(); } -void View::DrawZoneList( const Vector>& zones ) +void View::DrawZoneList( int id, const Vector>& zones ) { - if( !ImGui::BeginTable( "##zonelist", 3, ImGuiTableFlags_Resizable | ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_Sortable | ImGuiTableFlags_ScrollY ) ) return; + const auto zsz = zones.size(); + char buf[32]; + sprintf( buf, "%i##zonelist", id ); + if( !ImGui::BeginTable( buf, 3, ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_Resizable | ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_Sortable | ImGuiTableFlags_ScrollY, ImVec2( 0, ImGui::GetTextLineHeightWithSpacing() * std::min( zsz + 1, 15 ) ) ) ) return; ImGui::TableSetupScrollFreeze( 0, 1 ); ImGui::TableSetupColumn( "Time from start" ); ImGui::TableSetupColumn( "Execution time", ImGuiTableColumnFlags_PreferSortDescending ); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 788dbdef..414fa833 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -202,7 +202,7 @@ private: unordered_flat_map GetCallstackFrameTreeBottomUp( const MemData& mem ) const; unordered_flat_map GetCallstackFrameTreeTopDown( const MemData& mem ) const; void DrawFrameTreeLevel( const unordered_flat_map& tree, int& idx ); - void DrawZoneList( const Vector>& zones ); + void DrawZoneList( int id, const Vector>& zones ); void DrawInfoWindow(); void DrawZoneInfoWindow();