mirror of https://github.com/procxx/kepka.git
Apply edition updates to search result previews.
This commit is contained in:
parent
84399286c1
commit
cb5863177f
|
@ -1549,6 +1549,17 @@ void InnerWidget::repaintDialogRow(RowDescriptor row) {
|
|||
updateDialogRow(row);
|
||||
}
|
||||
|
||||
void InnerWidget::refreshDialogRow(RowDescriptor row) {
|
||||
if (row.fullId) {
|
||||
for (const auto &result : _searchResults) {
|
||||
if (result->item()->fullId() == row.fullId) {
|
||||
result->invalidateCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
repaintDialogRow(row);
|
||||
}
|
||||
|
||||
void InnerWidget::updateSearchResult(not_null<PeerData*> peer) {
|
||||
if (_state == WidgetState::Filtered) {
|
||||
if (!_peerSearchResults.empty()) {
|
||||
|
|
|
@ -92,6 +92,7 @@ public:
|
|||
void removeDialog(Key key);
|
||||
void repaintDialogRow(FilterId filterId, not_null<Row*> row);
|
||||
void repaintDialogRow(RowDescriptor row);
|
||||
void refreshDialogRow(RowDescriptor row);
|
||||
|
||||
void dragLeft();
|
||||
|
||||
|
|
|
@ -121,6 +121,11 @@ public:
|
|||
return _item;
|
||||
}
|
||||
|
||||
void invalidateCache() {
|
||||
_cacheFor = nullptr;
|
||||
_cache = Ui::Text::String();
|
||||
}
|
||||
|
||||
private:
|
||||
friend class Layout::RowPainter;
|
||||
|
||||
|
|
|
@ -549,6 +549,10 @@ void Widget::repaintDialogRow(RowDescriptor row) {
|
|||
_inner->repaintDialogRow(row);
|
||||
}
|
||||
|
||||
void Widget::refreshDialogRow(RowDescriptor row) {
|
||||
_inner->refreshDialogRow(row);
|
||||
}
|
||||
|
||||
void Widget::jumpToTop() {
|
||||
if (session().supportMode()) {
|
||||
return;
|
||||
|
|
|
@ -64,6 +64,7 @@ public:
|
|||
void removeDialog(Key key);
|
||||
void repaintDialogRow(FilterId filterId, not_null<Row*> row);
|
||||
void repaintDialogRow(RowDescriptor row);
|
||||
void refreshDialogRow(RowDescriptor row);
|
||||
|
||||
void jumpToTop();
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ PeerData *HistoryItem::displayFrom() const {
|
|||
void HistoryItem::invalidateChatListEntry() {
|
||||
if (const auto main = App::main()) {
|
||||
// #TODO feeds search results
|
||||
main->repaintDialogRow({ history(), fullId() });
|
||||
main->refreshDialogRow({ history(), fullId() });
|
||||
}
|
||||
|
||||
// invalidate cache for drawInDialog
|
||||
|
|
|
@ -2190,6 +2190,10 @@ void MainWidget::repaintDialogRow(Dialogs::RowDescriptor row) {
|
|||
_dialogs->repaintDialogRow(row);
|
||||
}
|
||||
|
||||
void MainWidget::refreshDialogRow(Dialogs::RowDescriptor row) {
|
||||
_dialogs->refreshDialogRow(row);
|
||||
}
|
||||
|
||||
void MainWidget::windowShown() {
|
||||
_history->windowShown();
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ public:
|
|||
void removeDialog(Dialogs::Key key);
|
||||
void repaintDialogRow(FilterId filterId, not_null<Dialogs::Row*> row);
|
||||
void repaintDialogRow(Dialogs::RowDescriptor row);
|
||||
void refreshDialogRow(Dialogs::RowDescriptor row);
|
||||
|
||||
void windowShown();
|
||||
|
||||
|
|
Loading…
Reference in New Issue