Improved display of cached message preview in profile sections.
This commit is contained in:
parent
749b2e0e95
commit
9e3e7265d2
|
@ -1364,7 +1364,11 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
|
|||
auto &lifetime = preview->lifetime();
|
||||
using namespace Dialogs::Ui;
|
||||
const auto previewView = lifetime.make_state<MessageView>();
|
||||
const auto previewUpdate = [=] { preview->update(); };
|
||||
preview->resize(0, st::infoLabeled.style.font->height);
|
||||
if (!previewView->dependsOn(item)) {
|
||||
previewView->prepare(item, nullptr, previewUpdate, {});
|
||||
}
|
||||
preview->paintRequest(
|
||||
) | rpl::start_with_next([=, fullId = item->fullId()](
|
||||
const QRect &rect) {
|
||||
|
@ -1393,11 +1397,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
|
|||
preview->rect(),
|
||||
tr::lng_contacts_loading(tr::now),
|
||||
style::al_left);
|
||||
previewView->prepare(
|
||||
item,
|
||||
nullptr,
|
||||
[=] { preview->update(); },
|
||||
{});
|
||||
previewView->prepare(item, nullptr, previewUpdate, {});
|
||||
preview->update();
|
||||
}
|
||||
}, preview->lifetime());
|
||||
|
|
Loading…
Reference in New Issue