Calculate proper message list size when children messages are excluded.

This commit is contained in:
Bartosz Taudul 2024-10-04 22:41:17 +02:00
parent 8d418760c0
commit 471ed0ef65
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -930,7 +930,25 @@ void View::DrawZoneInfoWindow()
SmallCheckbox( "Time relative to zone start", &m_messageTimeRelativeToZone );
ImGui::SameLine();
SmallCheckbox( "Exclude children", &m_messagesExcludeChildren );
if( ImGui::BeginTable( "##messages", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_BordersInnerV, ImVec2( 0, ImGui::GetTextLineHeightWithSpacing() * std::min<int64_t>( msgend-msgit+1, 15 ) ) ) )
int64_t viewSize;
if( !m_messagesExcludeChildren )
{
viewSize = std::min<int64_t>( msgend - msgit + 1, 15 );
}
else
{
viewSize = 0;
for( auto it = msgit; it < msgend; ++it )
{
if( !GetZoneChild( ev, (*it)->time ) )
{
viewSize++;
if( viewSize == 15 ) break;
}
}
if( viewSize < 15 ) viewSize++;
}
if( ImGui::BeginTable( "##messages", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_BordersInnerV, ImVec2( 0, ImGui::GetTextLineHeightWithSpacing() * viewSize ) ) )
{
ImGui::TableSetupScrollFreeze( 0, 1 );
ImGui::TableSetupColumn( "Time", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize );