From 7878552e7d436140051141b37b8f8fe637e6e2a4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 8 Jun 2021 13:40:01 +0400 Subject: [PATCH] Fix hiding rows with video in narrow column. --- .../calls/group/calls_group_members.cpp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index 7e536fad4f..49b5aa0052 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -147,7 +147,7 @@ private: void appendInvitedUsers(); void scheduleRaisedHandStatusRemove(); - void hideRowsWithVideoExcept(const VideoEndpoint &pinned); + void hideRowsWithVideoExcept(const VideoEndpoint &large); void showAllHiddenRows(); void hideRowWithVideo(const VideoEndpoint &endpoint); void showRowWithVideo(const VideoEndpoint &endpoint); @@ -316,17 +316,25 @@ void Members::Controller::setupListChangeViewers() { } void Members::Controller::hideRowsWithVideoExcept( - const VideoEndpoint &pinned) { - auto hidden = false; + const VideoEndpoint &large) { + auto changed = false; + auto showLargeRow = true; for (const auto &endpoint : _call->shownVideoTracks()) { - if (endpoint != pinned) { + if (endpoint != large) { if (const auto row = findRow(endpoint.peer)) { + if (endpoint.peer == large.peer) { + showLargeRow = false; + } delegate()->peerListSetRowHidden(row, true); - hidden = true; + changed = true; } } } - if (hidden) { + if (const auto row = showLargeRow ? findRow(large.peer) : nullptr) { + delegate()->peerListSetRowHidden(row, false); + changed = true; + } + if (changed) { delegate()->peerListRefreshRows(); } }