Find zones zone list fixes.

This commit is contained in:
Bartosz Taudul 2020-12-09 21:18:40 +01:00
parent f1a641a838
commit 63e0170048
2 changed files with 18 additions and 13 deletions

View File

@ -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<short_ptr<ZoneEvent>>& zones )
void View::DrawZoneList( int id, const Vector<short_ptr<ZoneEvent>>& 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<size_t>( zsz + 1, 15 ) ) ) ) return;
ImGui::TableSetupScrollFreeze( 0, 1 );
ImGui::TableSetupColumn( "Time from start" );
ImGui::TableSetupColumn( "Execution time", ImGuiTableColumnFlags_PreferSortDescending );

View File

@ -202,7 +202,7 @@ private:
unordered_flat_map<uint64_t, CallstackFrameTree> GetCallstackFrameTreeBottomUp( const MemData& mem ) const;
unordered_flat_map<uint64_t, CallstackFrameTree> GetCallstackFrameTreeTopDown( const MemData& mem ) const;
void DrawFrameTreeLevel( const unordered_flat_map<uint64_t, CallstackFrameTree>& tree, int& idx );
void DrawZoneList( const Vector<short_ptr<ZoneEvent>>& zones );
void DrawZoneList( int id, const Vector<short_ptr<ZoneEvent>>& zones );
void DrawInfoWindow();
void DrawZoneInfoWindow();