Limit "visible threads" rows displayed at once.

This commit is contained in:
Bartosz Taudul
2026-05-01 21:20:51 +02:00
parent 3900890ef4
commit 4394d79c39
3 changed files with 18 additions and 0 deletions
@@ -523,6 +523,11 @@ void View::DrawWaitStacks()
const auto MinWidth = std::max( 150 * GetScale(), probe );
const int cols = std::max( 1, int( ImGui::GetContentRegionAvail().x / MinWidth ) );
const auto rows = ( m_threadOrder.size() + cols - 1 ) / cols;
const auto rowsVisible = std::min<size_t>( rows, 8 );
const auto rowsHeight = ImGui::GetTextLineHeightWithSpacing() * rowsVisible;
ImGui::BeginChild( "###waitstackthreadrows", ImVec2( -1, rowsHeight ) );
int idx = 0;
ImGui::BeginTable( "##waitstackthreadcols", cols, ImGuiTableFlags_NoSavedSettings );
for( const auto& t : m_threadOrder )
@@ -552,6 +557,7 @@ void View::DrawWaitStacks()
}
}
ImGui::EndTable();
ImGui::EndChild();
ImGui::TreePop();
}
if( threadsChanged ) m_waitStack = 0;
@@ -848,6 +848,11 @@ void View::DrawFlameGraph()
const auto MinWidth = std::max( 150 * GetScale(), probe );
const int cols = std::max( 1, int( ImGui::GetContentRegionAvail().x / MinWidth ) );
const auto rows = ( tsz + cols - 1 ) / cols;
const auto rowsVisible = std::min<size_t>( rows, 8 );
const auto rowsHeight = ImGui::GetTextLineHeightWithSpacing() * rowsVisible;
ImGui::BeginChild( "###flamegraphthreadrows", ImVec2( -1, rowsHeight ) );
int idx = 0;
ImGui::BeginTable( "##flamegraphthreadcols", cols, ImGuiTableFlags_NoSavedSettings );
for( const auto& t : td )
@@ -866,6 +871,7 @@ void View::DrawFlameGraph()
}
}
ImGui::EndTable();
ImGui::EndChild();
ImGui::TreePop();
}
@@ -211,6 +211,11 @@ void View::DrawMessages()
const auto MinWidth = std::max( 150 * GetScale(), probe );
const int cols = std::max( 1, int( ImGui::GetContentRegionAvail().x / MinWidth ) );
const auto rows = ( tsz + cols - 1 ) / cols;
const auto rowsVisible = std::min<size_t>( rows, 8 );
const auto rowsHeight = ImGui::GetTextLineHeightWithSpacing() * rowsVisible;
ImGui::BeginChild( "###msgthreadrows", ImVec2( -1, rowsHeight ) );
int idx = 0;
ImGui::BeginTable( "##msgthreadcols", cols, ImGuiTableFlags_NoSavedSettings );
for( const auto& t : m_threadOrder )
@@ -240,6 +245,7 @@ void View::DrawMessages()
}
}
ImGui::EndTable();
ImGui::EndChild();
ImGui::TreePop();
}