2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Use tr:: instead of Lang::Viewer.

This commit is contained in:
John Preston
2019-06-18 14:16:43 +02:00
parent f35085800a
commit 7af0dd105e
43 changed files with 483 additions and 511 deletions

View File

@@ -77,15 +77,6 @@ void AddDividerText(
st::settingsDividerLabelPadding));
}
not_null<Button*> AddButton(
not_null<Ui::VerticalLayout*> container,
LangKey text,
const style::InfoProfileButton &st,
const style::icon *leftIcon,
int iconLeft) {
return AddButton(container, Lang::Viewer(text), st, leftIcon, iconLeft);
}
not_null<Button*> AddButton(
not_null<Ui::VerticalLayout*> container,
rpl::producer<QString> text,
@@ -127,13 +118,13 @@ void CreateRightLabel(
not_null<Button*> button,
rpl::producer<QString> label,
const style::InfoProfileButton &st,
LangKey buttonText) {
rpl::producer<QString> buttonText) {
const auto name = Ui::CreateChild<Ui::FlatLabel>(
button.get(),
st::settingsButtonRight);
rpl::combine(
button->widthValue(),
Lang::Viewer(buttonText),
std::move(buttonText),
std::move(label)
) | rpl::start_with_next([=, &st](
int width,
@@ -153,13 +144,18 @@ void CreateRightLabel(
not_null<Button*> AddButtonWithLabel(
not_null<Ui::VerticalLayout*> container,
LangKey text,
rpl::producer<QString> text,
rpl::producer<QString> label,
const style::InfoProfileButton &st,
const style::icon *leftIcon,
int iconLeft) {
const auto button = AddButton(container, text, st, leftIcon, iconLeft);
CreateRightLabel(button, std::move(label), st, text);
const auto button = AddButton(
container,
rpl::duplicate(text),
st,
leftIcon,
iconLeft);
CreateRightLabel(button, std::move(label), st, std::move(text));
return button;
}
@@ -174,12 +170,6 @@ void AddSubsectionTitle(
st::settingsSubsectionTitlePadding);
}
void AddSubsectionTitle(
not_null<Ui::VerticalLayout*> container,
LangKey text) {
AddSubsectionTitle(container, Lang::Viewer(text));
}
void FillMenu(Fn<void(Type)> showOther, MenuCallback addAction) {
if (!Auth().supportMode()) {
addAction(