mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Disable paint updates while applying room filtering (#380)
This commit is contained in:
parent
6c65213c83
commit
73e3161c88
1 changed files with 5 additions and 0 deletions
|
@ -355,6 +355,9 @@ RoomList::removeFilter()
|
||||||
void
|
void
|
||||||
RoomList::applyFilter(const std::map<QString, bool> &filter)
|
RoomList::applyFilter(const std::map<QString, bool> &filter)
|
||||||
{
|
{
|
||||||
|
// Disabling paint updates will resolve issues with screen flickering on big room lists.
|
||||||
|
setUpdatesEnabled(false);
|
||||||
|
|
||||||
for (int i = 0; i < contentsLayout_->count(); i++) {
|
for (int i = 0; i < contentsLayout_->count(); i++) {
|
||||||
// If filter contains the room for the current RoomInfoListItem,
|
// If filter contains the room for the current RoomInfoListItem,
|
||||||
// show the list item, otherwise hide it
|
// show the list item, otherwise hide it
|
||||||
|
@ -370,6 +373,8 @@ RoomList::applyFilter(const std::map<QString, bool> &filter)
|
||||||
listitem->hide();
|
listitem->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setUpdatesEnabled(true);
|
||||||
|
|
||||||
// If the already selected room is part of the group, make sure it's visible.
|
// If the already selected room is part of the group, make sure it's visible.
|
||||||
if (!selectedRoom_.isEmpty() && (filter.find(selectedRoom_) != filter.end()))
|
if (!selectedRoom_.isEmpty() && (filter.find(selectedRoom_) != filter.end()))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue