Fix hiding rows with video in narrow column.

This commit is contained in:
John Preston 2021-06-08 13:40:01 +04:00
parent b3648d0147
commit 7878552e7d
1 changed files with 14 additions and 6 deletions

View File

@ -147,7 +147,7 @@ private:
void appendInvitedUsers(); void appendInvitedUsers();
void scheduleRaisedHandStatusRemove(); void scheduleRaisedHandStatusRemove();
void hideRowsWithVideoExcept(const VideoEndpoint &pinned); void hideRowsWithVideoExcept(const VideoEndpoint &large);
void showAllHiddenRows(); void showAllHiddenRows();
void hideRowWithVideo(const VideoEndpoint &endpoint); void hideRowWithVideo(const VideoEndpoint &endpoint);
void showRowWithVideo(const VideoEndpoint &endpoint); void showRowWithVideo(const VideoEndpoint &endpoint);
@ -316,17 +316,25 @@ void Members::Controller::setupListChangeViewers() {
} }
void Members::Controller::hideRowsWithVideoExcept( void Members::Controller::hideRowsWithVideoExcept(
const VideoEndpoint &pinned) { const VideoEndpoint &large) {
auto hidden = false; auto changed = false;
auto showLargeRow = true;
for (const auto &endpoint : _call->shownVideoTracks()) { for (const auto &endpoint : _call->shownVideoTracks()) {
if (endpoint != pinned) { if (endpoint != large) {
if (const auto row = findRow(endpoint.peer)) { if (const auto row = findRow(endpoint.peer)) {
if (endpoint.peer == large.peer) {
showLargeRow = false;
}
delegate()->peerListSetRowHidden(row, true); 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(); delegate()->peerListRefreshRows();
} }
} }