Removed first animation from radio button in premium graphics.
This commit is contained in:
parent
6d69a78a05
commit
3a472d1b90
|
@ -156,14 +156,15 @@ void GiftBox(
|
|||
|
||||
// List.
|
||||
const auto group = std::make_shared<Ui::RadiobuttonGroup>();
|
||||
group->setChangedCallback([=](int value) {
|
||||
const auto groupValueChangedCallback = [=](int value) {
|
||||
Expects(value < options.size() && value >= 0);
|
||||
auto text = tr::lng_premium_gift_button(
|
||||
tr::now,
|
||||
lt_cost,
|
||||
options[value].costTotal);
|
||||
state->buttonText.fire(std::move(text));
|
||||
});
|
||||
};
|
||||
group->setChangedCallback(groupValueChangedCallback);
|
||||
Ui::Premium::AddGiftOptions(
|
||||
buttonsParent,
|
||||
group,
|
||||
|
@ -215,7 +216,7 @@ void GiftBox(
|
|||
});
|
||||
box->addButton(std::move(button));
|
||||
|
||||
group->setValue(0);
|
||||
groupValueChangedCallback(0);
|
||||
|
||||
Data::PeerPremiumValue(
|
||||
user
|
||||
|
|
|
@ -1653,7 +1653,7 @@ QPointer<Ui::RpWidget> Premium::createPinnedToBottom(
|
|||
} else {
|
||||
#endif
|
||||
{
|
||||
_radioGroup->setChangedCallback([=](int value) {
|
||||
const auto callback = [=](int value) {
|
||||
const auto options =
|
||||
_controller->session().api().premium().subscriptionOptions();
|
||||
if (options.empty()) {
|
||||
|
@ -1665,8 +1665,9 @@ QPointer<Ui::RpWidget> Premium::createPinnedToBottom(
|
|||
lt_cost,
|
||||
options[value].costPerMonth);
|
||||
_buttonText = std::move(text);
|
||||
});
|
||||
_radioGroup->setValue(0);
|
||||
};
|
||||
_radioGroup->setChangedCallback(callback);
|
||||
callback(0);
|
||||
}
|
||||
|
||||
_showFinished.events(
|
||||
|
|
|
@ -1138,6 +1138,10 @@ void AddGiftOptions(
|
|||
stCheckbox,
|
||||
std::move(radioView));
|
||||
radio->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
{ // Paint the last frame instantly for the layer animation.
|
||||
group->setValue(0);
|
||||
radio->finishAnimating();
|
||||
}
|
||||
|
||||
row->sizeValue(
|
||||
) | rpl::start_with_next([=, margins = stCheckbox.margin](
|
||||
|
|
Loading…
Reference in New Issue