mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Added spoiler entity to email pattern in intro and cloud password.
This commit is contained in:
parent
43dfe559a6
commit
9e18964e7f
7 changed files with 43 additions and 15 deletions
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/passcode_box.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "intro/intro_signup.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
|
@ -350,8 +351,11 @@ void PasswordCheckWidget::updateDescriptionText() {
|
|||
auto pwdHidden = _pwdField->isHidden();
|
||||
auto emailPattern = _emailPattern;
|
||||
setDescriptionText(pwdHidden
|
||||
? tr::lng_signin_recover_desc(lt_email, rpl::single(emailPattern))
|
||||
: tr::lng_signin_desc());
|
||||
? tr::lng_signin_recover_desc(
|
||||
lt_email,
|
||||
rpl::single(Ui::Text::WrapEmailPattern(emailPattern)),
|
||||
Ui::Text::WithEntities)
|
||||
: tr::lng_signin_desc(Ui::Text::WithEntities));
|
||||
}
|
||||
|
||||
void PasswordCheckWidget::submit() {
|
||||
|
|
|
@ -99,7 +99,19 @@ Step::Step(
|
|||
|
||||
_descriptionText.value(
|
||||
) | rpl::start_with_next([=](const TextWithEntities &text) {
|
||||
_description->entity()->setMarkedText(text);
|
||||
const auto label = _description->entity();
|
||||
const auto hasSpoiler = ranges::contains(
|
||||
text.entities,
|
||||
EntityType::Spoiler,
|
||||
&EntityInText::type);
|
||||
if (hasSpoiler) {
|
||||
label->setMarkedText(
|
||||
text,
|
||||
CommonTextContext{ [=] { label->update(); } });
|
||||
} else {
|
||||
label->setMarkedText(text);
|
||||
}
|
||||
label->setAttribute(Qt::WA_TransparentForMouseEvents, hasSpoiler);
|
||||
updateLabelsPosition();
|
||||
}, lifetime());
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ void SetupHeader(
|
|||
const QString &lottie,
|
||||
rpl::producer<> &&showFinished,
|
||||
rpl::producer<QString> &&subtitle,
|
||||
rpl::producer<QString> &&about) {
|
||||
v::text::data &&about) {
|
||||
if (!lottie.isEmpty()) {
|
||||
const auto &size = st::settingsCloudPasswordIconSize;
|
||||
auto icon = CreateLottieIcon(
|
||||
|
@ -148,8 +148,16 @@ void SetupHeader(
|
|||
const auto wrap = content->add(
|
||||
object_ptr<Ui::CenterWrap<>>(
|
||||
content,
|
||||
object_ptr<Ui::FlatLabel>(content, std::move(about), st)),
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
content,
|
||||
v::text::take_marked(std::move(about)),
|
||||
st,
|
||||
st::defaultPopupMenu,
|
||||
[=](Fn<void()> update) {
|
||||
return CommonTextContext{ std::move(update) };
|
||||
})),
|
||||
st::changePhoneDescriptionPadding);
|
||||
wrap->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
wrap->resize(
|
||||
wrap->width(),
|
||||
st::settingLocalPasscodeDescriptionHeight);
|
||||
|
|
|
@ -50,7 +50,7 @@ void SetupHeader(
|
|||
const QString &lottie,
|
||||
rpl::producer<> &&showFinished,
|
||||
rpl::producer<QString> &&subtitle,
|
||||
rpl::producer<QString> &&about);
|
||||
v::text::data &&about);
|
||||
|
||||
[[nodiscard]] not_null<Ui::PasswordInput*> AddPasswordField(
|
||||
not_null<Ui::VerticalLayout*> content,
|
||||
|
|
|
@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/vertical_list.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/menu/menu_add_action_callback.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/sent_code_field.h"
|
||||
|
@ -138,13 +139,14 @@ void EmailConfirm::setupContent() {
|
|||
state->unconfirmedPattern.isEmpty()
|
||||
? tr::lng_settings_cloud_password_email_recovery_subtitle()
|
||||
: tr::lng_cloud_password_confirm(),
|
||||
rpl::single(
|
||||
tr::lng_cloud_password_waiting_code(
|
||||
tr::now,
|
||||
lt_email,
|
||||
state->unconfirmedPattern.isEmpty()
|
||||
? recoverEmailPattern
|
||||
: state->unconfirmedPattern)));
|
||||
tr::lng_cloud_password_waiting_code(
|
||||
lt_email,
|
||||
rpl::single(
|
||||
Ui::Text::WrapEmailPattern(
|
||||
state->unconfirmedPattern.isEmpty()
|
||||
? recoverEmailPattern
|
||||
: state->unconfirmedPattern)),
|
||||
TextWithEntities::Simple));
|
||||
|
||||
Ui::AddSkip(content, st::settingLocalPasscodeDescriptionBottomSkip);
|
||||
|
||||
|
|
|
@ -183,7 +183,9 @@ void Input::setupContent() {
|
|||
: hasPassword
|
||||
? tr::lng_settings_cloud_password_manage_password_change()
|
||||
: tr::lng_settings_cloud_password_password_subtitle(),
|
||||
tr::lng_cloud_password_about());
|
||||
isCheck
|
||||
? tr::lng_settings_cloud_password_manage_about1()
|
||||
: tr::lng_cloud_password_about());
|
||||
|
||||
Ui::AddSkip(content, st::settingLocalPasscodeDescriptionBottomSkip);
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit d54a4bb510a730d519f6085f81ca021c610402ee
|
||||
Subproject commit 517be45510ffde54ccb928788d700f93cfba3b65
|
Loading…
Add table
Reference in a new issue