mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Removed confusing lock state from button in earn out section.
This commit is contained in:
parent
84f111d641
commit
15c226e6cf
4 changed files with 18 additions and 14 deletions
|
@ -244,9 +244,7 @@ void InnerWidget::fill() {
|
|||
),
|
||||
rpl::duplicate(availableBalanceValue),
|
||||
rpl::duplicate(dateValue),
|
||||
rpl::duplicate(dateValue) | rpl::map([=](const QDateTime &dt) {
|
||||
return !dt.isNull() || (!_state.isWithdrawalEnabled);
|
||||
}),
|
||||
_state.isWithdrawalEnabled,
|
||||
rpl::duplicate(
|
||||
availableBalanceValue
|
||||
) | rpl::map([=](StarsAmount v) {
|
||||
|
|
|
@ -954,10 +954,7 @@ void InnerWidget::fill() {
|
|||
),
|
||||
rpl::duplicate(availableBalanceValue),
|
||||
rpl::duplicate(dateValue),
|
||||
std::move(dateValue) | rpl::map([=](const QDateTime &dt) {
|
||||
return !dt.isNull()
|
||||
|| (!_state.creditsEarn.isWithdrawalEnabled);
|
||||
}),
|
||||
_state.creditsEarn.isWithdrawalEnabled,
|
||||
rpl::duplicate(
|
||||
availableBalanceValue
|
||||
) | rpl::map(creditsToUsdMap));
|
||||
|
|
|
@ -1873,7 +1873,7 @@ void AddWithdrawalWidget(
|
|||
rpl::producer<QString> secondButtonUrl,
|
||||
rpl::producer<StarsAmount> availableBalanceValue,
|
||||
rpl::producer<QDateTime> dateValue,
|
||||
rpl::producer<bool> lockedValue,
|
||||
bool withdrawalEnabled,
|
||||
rpl::producer<QString> usdValue) {
|
||||
Ui::AddSkip(container);
|
||||
|
||||
|
@ -1915,17 +1915,22 @@ void AddWithdrawalWidget(
|
|||
|
||||
Ui::AddSkip(container);
|
||||
|
||||
const auto withdrawalWrap = container->add(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
container,
|
||||
object_ptr<Ui::VerticalLayout>(container)));
|
||||
const auto input = Ui::AddInputFieldForCredits(
|
||||
container,
|
||||
withdrawalWrap->entity(),
|
||||
rpl::duplicate(availableBalanceValue));
|
||||
|
||||
Ui::AddSkip(container);
|
||||
Ui::AddSkip(container);
|
||||
Ui::AddSkip(withdrawalWrap->entity());
|
||||
Ui::AddSkip(withdrawalWrap->entity());
|
||||
|
||||
const auto &stButton = st::defaultActiveButton;
|
||||
const auto buttonsContainer = container->add(
|
||||
Ui::CreateSkipWidget(container, stButton.height),
|
||||
const auto buttonsContainer = withdrawalWrap->entity()->add(
|
||||
Ui::CreateSkipWidget(withdrawalWrap->entity(), stButton.height),
|
||||
st::boxRowPadding);
|
||||
withdrawalWrap->toggle(withdrawalEnabled, anim::type::instant);
|
||||
|
||||
const auto button = Ui::CreateChild<Ui::RoundButton>(
|
||||
buttonsContainer,
|
||||
|
@ -1959,6 +1964,10 @@ void AddWithdrawalWidget(
|
|||
}
|
||||
}, buttonsContainer->lifetime());
|
||||
|
||||
auto lockedValue = rpl::duplicate(
|
||||
dateValue
|
||||
) | rpl::map([](const QDateTime &dt) { return !dt.isNull(); });
|
||||
|
||||
rpl::duplicate(
|
||||
lockedValue
|
||||
) | rpl::start_with_next([=](bool v) {
|
||||
|
|
|
@ -76,7 +76,7 @@ void AddWithdrawalWidget(
|
|||
rpl::producer<QString> secondButtonUrl,
|
||||
rpl::producer<StarsAmount> availableBalanceValue,
|
||||
rpl::producer<QDateTime> dateValue,
|
||||
rpl::producer<bool> lockedValue,
|
||||
bool withdrawalEnabled,
|
||||
rpl::producer<QString> usdValue);
|
||||
|
||||
void ReceiptCreditsBox(
|
||||
|
|
Loading…
Add table
Reference in a new issue