mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Preload premium previews even with Close button.
This commit is contained in:
parent
0a81246502
commit
08ebff4e5d
1 changed files with 9 additions and 5 deletions
|
@ -1454,7 +1454,14 @@ void PreviewBox(
|
||||||
box->addRow(
|
box->addRow(
|
||||||
CreateSwitch(box->verticalLayout(), &state->selected),
|
CreateSwitch(box->verticalLayout(), &state->selected),
|
||||||
st::premiumDotsMargin);
|
st::premiumDotsMargin);
|
||||||
|
const auto showFinished = [=] {
|
||||||
|
state->showFinished = true;
|
||||||
|
if (base::take(state->preloadScheduled)) {
|
||||||
|
state->preload();
|
||||||
|
}
|
||||||
|
};
|
||||||
if (descriptor.fromSettings && controller->session().premium()) {
|
if (descriptor.fromSettings && controller->session().premium()) {
|
||||||
|
box->setShowFinishedCallback(showFinished);
|
||||||
box->addButton(tr::lng_close(), [=] { box->closeBox(); });
|
box->addButton(tr::lng_close(), [=] { box->closeBox(); });
|
||||||
} else {
|
} else {
|
||||||
box->setStyle(st::premiumPreviewBox);
|
box->setStyle(st::premiumPreviewBox);
|
||||||
|
@ -1485,11 +1492,8 @@ void PreviewBox(
|
||||||
Settings::LookupPremiumRef(state->selected.current()));
|
Settings::LookupPremiumRef(state->selected.current()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
box->setShowFinishedCallback([=, raw = button.data()] {
|
box->setShowFinishedCallback([=, raw = button.data()]{
|
||||||
state->showFinished = true;
|
showFinished();
|
||||||
if (base::take(state->preloadScheduled)) {
|
|
||||||
state->preload();
|
|
||||||
}
|
|
||||||
raw->startGlareAnimation();
|
raw->startGlareAnimation();
|
||||||
});
|
});
|
||||||
box->addButton(std::move(button));
|
box->addButton(std::move(button));
|
||||||
|
|
Loading…
Add table
Reference in a new issue