mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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(
|
void InnerWidget::dialogRowReplaced(
|
||||||
Row *oldRow,
|
Row *oldRow,
|
||||||
Row *newRow) {
|
Row *newRow) {
|
||||||
|
auto found = false;
|
||||||
if (_state == WidgetState::Filtered) {
|
if (_state == WidgetState::Filtered) {
|
||||||
|
auto top = 0;
|
||||||
for (auto i = _filterResults.begin(); i != _filterResults.end();) {
|
for (auto i = _filterResults.begin(); i != _filterResults.end();) {
|
||||||
if (i->row == oldRow) { // this row is shown in filtered and maybe is in contacts!
|
if (i->row == oldRow) { // this row is shown in filtered and maybe is in contacts!
|
||||||
if (newRow) {
|
found = true;
|
||||||
i->row = newRow;
|
top = i->top;
|
||||||
++i;
|
if (!newRow) {
|
||||||
} else {
|
|
||||||
i = _filterResults.erase(i);
|
i = _filterResults.erase(i);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
i->row = newRow;
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
|
if (found) {
|
||||||
|
i->top = top;
|
||||||
|
top += i->row->height();
|
||||||
|
}
|
||||||
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_selected == oldRow) {
|
if (_selected == oldRow) {
|
||||||
|
@ -1801,6 +1807,9 @@ void InnerWidget::dialogRowReplaced(
|
||||||
stopReorderPinned();
|
stopReorderPinned();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (found) {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InnerWidget::handleChatListEntryRefreshes() {
|
void InnerWidget::handleChatListEntryRefreshes() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue