mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix deleting a search result in chats list.
This commit is contained in:
parent
af350e2daa
commit
5ebea97ded
1 changed files with 15 additions and 6 deletions
|
@ -1774,18 +1774,24 @@ void InnerWidget::moveCancelSearchButtons() {
|
|||
void InnerWidget::dialogRowReplaced(
|
||||
Row *oldRow,
|
||||
Row *newRow) {
|
||||
auto found = false;
|
||||
if (_state == WidgetState::Filtered) {
|
||||
auto top = 0;
|
||||
for (auto i = _filterResults.begin(); i != _filterResults.end();) {
|
||||
if (i->row == oldRow) { // this row is shown in filtered and maybe is in contacts!
|
||||
if (newRow) {
|
||||
i->row = newRow;
|
||||
++i;
|
||||
} else {
|
||||
found = true;
|
||||
top = i->top;
|
||||
if (!newRow) {
|
||||
i = _filterResults.erase(i);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
++i;
|
||||
i->row = newRow;
|
||||
}
|
||||
if (found) {
|
||||
i->top = top;
|
||||
top += i->row->height();
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
if (_selected == oldRow) {
|
||||
|
@ -1801,6 +1807,9 @@ void InnerWidget::dialogRowReplaced(
|
|||
stopReorderPinned();
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void InnerWidget::handleChatListEntryRefreshes() {
|
||||
|
|
Loading…
Add table
Reference in a new issue