summary refs log tree commit diff
path: root/src/RoomList.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-02-01 18:42:38 -0500
committerJoseph Donofry <joedonofry@gmail.com>2021-02-01 18:42:38 -0500
commit53c653a228f529bab3753ca99dee18a5bf5342a2 (patch)
treead0ba40d27ca5a515f1f33c29c910e5cf7b20dd7 /src/RoomList.cpp
parentRemove redundant import and fix visible warning (diff)
parentFix emojis with fe0f in the middle (diff)
downloadnheko-53c653a228f529bab3753ca99dee18a5bf5342a2.tar.xz
Merge remote-tracking branch 'nheko-im/master' into privacy_screen
Diffstat (limited to 'src/RoomList.cpp')
-rw-r--r--src/RoomList.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/RoomList.cpp b/src/RoomList.cpp

index aab89491..764a8e42 100644 --- a/src/RoomList.cpp +++ b/src/RoomList.cpp
@@ -50,8 +50,8 @@ RoomList::RoomList(QSharedPointer<UserSettings> userSettings, QWidget *parent) QScroller::grabGesture(scrollArea_, QScroller::TouchGesture); QScroller::grabGesture(scrollArea_, QScroller::LeftMouseButtonGesture); - // The scrollbar on macOS will hide itself when not active so it won't interfere - // with the content. +// The scrollbar on macOS will hide itself when not active so it won't interfere +// with the content. #if not defined(Q_OS_MAC) scrollArea_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); #endif @@ -411,20 +411,24 @@ RoomList::closeJoinRoomDialog(bool isJoining, QString roomAlias) } void -RoomList::removeFilter() +RoomList::removeFilter(const std::set<QString> &roomsToHide) { setUpdatesEnabled(false); for (int i = 0; i < contentsLayout_->count(); i++) { auto widget = qobject_cast<RoomInfoListItem *>(contentsLayout_->itemAt(i)->widget()); - if (widget) - widget->show(); + if (widget) { + if (roomsToHide.find(widget->roomId()) == roomsToHide.end()) + widget->show(); + else + widget->hide(); + } } setUpdatesEnabled(true); } void -RoomList::applyFilter(const std::map<QString, bool> &filter) +RoomList::applyFilter(const std::set<QString> &filter) { // Disabling paint updates will resolve issues with screen flickering on big room lists. setUpdatesEnabled(false);