mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Slightly improved input of credits with large numbers for invite links.
This commit is contained in:
parent
0c3cabf4ac
commit
3905fc7c38
1 changed files with 5 additions and 1 deletions
|
@ -73,7 +73,7 @@ InviteLinkSubscriptionToggle FillCreateInviteLinkSubscriptionToggle(
|
||||||
st,
|
st,
|
||||||
tr::lng_group_invite_subscription_ph(),
|
tr::lng_group_invite_subscription_ph(),
|
||||||
QString(),
|
QString(),
|
||||||
maxCredits);
|
std::pow(QString::number(maxCredits).size(), 10));
|
||||||
wrap->toggledValue() | rpl::start_with_next([=](bool shown) {
|
wrap->toggledValue() | rpl::start_with_next([=](bool shown) {
|
||||||
if (shown) {
|
if (shown) {
|
||||||
input->setFocus();
|
input->setFocus();
|
||||||
|
@ -97,6 +97,10 @@ InviteLinkSubscriptionToggle FillCreateInviteLinkSubscriptionToggle(
|
||||||
}, input->lifetime());
|
}, input->lifetime());
|
||||||
ToggleChildrenVisibility(inputContainer, true);
|
ToggleChildrenVisibility(inputContainer, true);
|
||||||
QObject::connect(input, &Ui::MaskedInputField::changed, [=] {
|
QObject::connect(input, &Ui::MaskedInputField::changed, [=] {
|
||||||
|
const auto amount = input->getLastText().toDouble();
|
||||||
|
if (amount > maxCredits) {
|
||||||
|
input->setText(QString::number(maxCredits));
|
||||||
|
}
|
||||||
priceOverlay->update();
|
priceOverlay->update();
|
||||||
});
|
});
|
||||||
priceOverlay->paintRequest(
|
priceOverlay->paintRequest(
|
||||||
|
|
Loading…
Add table
Reference in a new issue