mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Returned display of button in box for passkey creation when unsupported.
This commit is contained in:
@@ -1270,6 +1270,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_settings_passkeys_none_info3_title" = "Store Passkey securely";
|
||||
"lng_settings_passkeys_none_info3_about" = "Your passkey is stored safely in the cloud service you choose.";
|
||||
"lng_settings_passkeys_none_button" = "Create Passkey";
|
||||
"lng_settings_passkeys_none_button_unsupported" = "Unsupported";
|
||||
"lng_settings_passkeys_created" = "Created {date}";
|
||||
"lng_settings_passkeys_last_used" = "Last used {date}";
|
||||
"lng_settings_passkeys_unsigned_error" = "Passkeys are not available in unsigned builds. Please use an official signed version of Telegram Desktop.";
|
||||
|
||||
@@ -171,12 +171,15 @@ void PasskeysNoneBox(
|
||||
}
|
||||
Ui::AddSkip(content);
|
||||
Ui::AddSkip(content);
|
||||
if (session->passkeys().canRegister()) {
|
||||
{
|
||||
const auto &st = st::premiumPreviewDoubledLimitsBox;
|
||||
const auto canRegister = session->passkeys().canRegister();
|
||||
box->setStyle(st);
|
||||
auto button = object_ptr<Ui::RoundButton>(
|
||||
box,
|
||||
tr::lng_settings_passkeys_none_button(),
|
||||
canRegister
|
||||
? tr::lng_settings_passkeys_none_button()
|
||||
: tr::lng_settings_passkeys_none_button_unsupported(),
|
||||
st::defaultActiveButton);
|
||||
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||
button->resizeToWidth(box->width()
|
||||
@@ -202,6 +205,11 @@ void PasskeysNoneBox(
|
||||
});
|
||||
});
|
||||
});
|
||||
if (!canRegister) {
|
||||
button->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
button->setTextFgOverride(
|
||||
anim::with_alpha(button->st().textFg->c, 0.5));
|
||||
}
|
||||
box->addButton(std::move(button));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user