mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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->toggle(type == GiveawayType::Random, anim::type::instant);
|
||||||
}, randomWrap->lifetime());
|
}, randomWrap->lifetime());
|
||||||
|
|
||||||
|
randomWrap->toggleOn(
|
||||||
|
state->typeValue.value(
|
||||||
|
) | rpl::map(rpl::mappers::_1 == GiveawayType::Random),
|
||||||
|
anim::type::instant);
|
||||||
|
|
||||||
const auto sliderContainer = randomWrap->entity()->add(
|
const auto sliderContainer = randomWrap->entity()->add(
|
||||||
object_ptr<Ui::VerticalLayout>(randomWrap));
|
object_ptr<Ui::VerticalLayout>(randomWrap));
|
||||||
const auto fillSliderContainer = [=] {
|
const auto fillSliderContainer = [=] {
|
||||||
|
@ -574,18 +579,19 @@ void CreateGiveawayBox(
|
||||||
box->setStyle(stButton);
|
box->setStyle(stButton);
|
||||||
auto button = object_ptr<Ui::RoundButton>(
|
auto button = object_ptr<Ui::RoundButton>(
|
||||||
box,
|
box,
|
||||||
state->toAwardAmountChanged.events_starting_with(
|
rpl::conditional(
|
||||||
rpl::empty_value()
|
state->typeValue.value(
|
||||||
) | rpl::map([=] {
|
) | rpl::map(rpl::mappers::_1 == GiveawayType::Random),
|
||||||
return (typeGroup->value() == GiveawayType::SpecificUsers)
|
tr::lng_giveaway_start(),
|
||||||
? tr::lng_giveaway_award()
|
tr::lng_giveaway_award()),
|
||||||
: tr::lng_giveaway_start();
|
|
||||||
}) | rpl::flatten_latest(),
|
|
||||||
st::giveawayGiftCodeStartButton);
|
st::giveawayGiftCodeStartButton);
|
||||||
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||||
button->resizeToWidth(box->width()
|
state->typeValue.value(
|
||||||
- stButton.buttonPadding.left()
|
) | rpl::start_with_next([=, raw = button.data()] {
|
||||||
- stButton.buttonPadding.right());
|
raw->resizeToWidth(box->width()
|
||||||
|
- stButton.buttonPadding.left()
|
||||||
|
- stButton.buttonPadding.right());
|
||||||
|
}, button->lifetime());
|
||||||
button->setClickedCallback([=] {
|
button->setClickedCallback([=] {
|
||||||
if (state->confirmButtonBusy) {
|
if (state->confirmButtonBusy) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue