Added top close button to ReceiptCreditsBox.

This commit is contained in:
23rd 2024-11-14 04:02:07 +03:00 committed by John Preston
parent 73936dca73
commit 27a5ba4681
2 changed files with 13 additions and 7 deletions

View file

@ -473,15 +473,11 @@ void SendCreditsBox(
{
const auto close = Ui::CreateChild<Ui::IconButton>(
box.get(),
content,
st::boxTitleClose);
close->setClickedCallback([=] {
box->closeBox();
});
box->widthValue(
) | rpl::start_with_next([=](int width) {
close->setClickedCallback([=] { box->closeBox(); });
content->widthValue() | rpl::start_with_next([=](int) {
close->moveToRight(0, 0);
close->raise();
}, close->lifetime());
}

View file

@ -1434,6 +1434,16 @@ void ReceiptCreditsBox(
}
};
if ((toRenew || canConvert || couldConvert || nonConvertible) && peer) {
const auto close = Ui::CreateChild<Ui::IconButton>(
content,
st::boxTitleClose);
close->setClickedCallback([=] { box->closeBox(); });
content->widthValue() | rpl::start_with_next([=](int) {
close->moveToRight(0, 0);
}, content->lifetime());
}
const auto button = box->addButton(std::move(confirmText), [=] {
if (state->confirmButtonBusy.current()
|| state->convertButtonBusy.current()) {