mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fixed text of confirm box in giveaway box.
This commit is contained in:
parent
6eb7d68d49
commit
1cb762913c
1 changed files with 16 additions and 10 deletions
|
@ -237,6 +237,11 @@ void CreateGiveawayBox(
|
|||
randomWrap->toggle(type == GiveawayType::Random, anim::type::instant);
|
||||
}, randomWrap->lifetime());
|
||||
|
||||
randomWrap->toggleOn(
|
||||
state->typeValue.value(
|
||||
) | rpl::map(rpl::mappers::_1 == GiveawayType::Random),
|
||||
anim::type::instant);
|
||||
|
||||
const auto sliderContainer = randomWrap->entity()->add(
|
||||
object_ptr<Ui::VerticalLayout>(randomWrap));
|
||||
const auto fillSliderContainer = [=] {
|
||||
|
@ -574,18 +579,19 @@ void CreateGiveawayBox(
|
|||
box->setStyle(stButton);
|
||||
auto button = object_ptr<Ui::RoundButton>(
|
||||
box,
|
||||
state->toAwardAmountChanged.events_starting_with(
|
||||
rpl::empty_value()
|
||||
) | rpl::map([=] {
|
||||
return (typeGroup->value() == GiveawayType::SpecificUsers)
|
||||
? tr::lng_giveaway_award()
|
||||
: tr::lng_giveaway_start();
|
||||
}) | rpl::flatten_latest(),
|
||||
rpl::conditional(
|
||||
state->typeValue.value(
|
||||
) | rpl::map(rpl::mappers::_1 == GiveawayType::Random),
|
||||
tr::lng_giveaway_start(),
|
||||
tr::lng_giveaway_award()),
|
||||
st::giveawayGiftCodeStartButton);
|
||||
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||
button->resizeToWidth(box->width()
|
||||
- stButton.buttonPadding.left()
|
||||
- stButton.buttonPadding.right());
|
||||
state->typeValue.value(
|
||||
) | rpl::start_with_next([=, raw = button.data()] {
|
||||
raw->resizeToWidth(box->width()
|
||||
- stButton.buttonPadding.left()
|
||||
- stButton.buttonPadding.right());
|
||||
}, button->lifetime());
|
||||
button->setClickedCallback([=] {
|
||||
if (state->confirmButtonBusy) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue