Removed text commands from url auth box.

This commit is contained in:
23rd 2021-12-25 20:42:43 +03:00 committed by John Preston
parent 97dde7eb56
commit d6801517bb

View file

@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "core/click_handler_types.h" #include "core/click_handler_types.h"
#include "ui/text/text_utilities.h"
#include "ui/wrap/vertical_layout.h" #include "ui/wrap/vertical_layout.h"
#include "ui/widgets/checkbox.h" #include "ui/widgets/checkbox.h"
#include "ui/widgets/labels.h" #include "ui/widgets/labels.h"
@ -255,11 +256,11 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
tr::lng_url_auth_open_confirm(tr::now, lt_link, url), tr::lng_url_auth_open_confirm(tr::now, lt_link, url),
st::boxLabel), st::boxLabel),
st::boxPadding); st::boxPadding);
const auto addCheckbox = [&](const QString &text) { const auto addCheckbox = [&](const TextWithEntities &text) {
const auto checkbox = result->add( const auto checkbox = result->add(
object_ptr<Ui::Checkbox>( object_ptr<Ui::Checkbox>(
result, result,
QString(), text,
true, true,
st::urlAuthCheckbox), st::urlAuthCheckbox),
style::margins( style::margins(
@ -268,23 +269,22 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
st::boxPadding.right(), st::boxPadding.right(),
st::boxPadding.bottom())); st::boxPadding.bottom()));
checkbox->setAllowTextLines(); checkbox->setAllowTextLines();
checkbox->setText(text, true);
return checkbox; return checkbox;
}; };
const auto auth = addCheckbox( const auto auth = addCheckbox(
tr::lng_url_auth_login_option( tr::lng_url_auth_login_option(
tr::now, tr::now,
lt_domain, lt_domain,
textcmdStartSemibold() + domain + textcmdStopSemibold(), Ui::Text::Bold(domain),
lt_user, lt_user,
(textcmdStartSemibold() Ui::Text::Bold(session->user()->name),
+ session->user()->name Ui::Text::WithEntities));
+ textcmdStopSemibold())));
const auto allow = bot const auto allow = bot
? addCheckbox(tr::lng_url_auth_allow_messages( ? addCheckbox(tr::lng_url_auth_allow_messages(
tr::now, tr::now,
lt_bot, lt_bot,
textcmdStartSemibold() + bot->firstName + textcmdStopSemibold())) Ui::Text::Bold(bot->firstName),
Ui::Text::WithEntities))
: nullptr; : nullptr;
if (allow) { if (allow) {
rpl::single( rpl::single(