2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Add "Translate Entire Chat" button to Settings.

This commit is contained in:
John Preston
2023-01-30 18:01:10 +04:00
parent f5be551ff8
commit be71139515
14 changed files with 148 additions and 78 deletions

View File

@@ -251,6 +251,7 @@ void Cover::refreshUsernameGeometry(int newWidth) {
} // namespace
void SetupLanguageButton(
not_null<Window::Controller*> window,
not_null<Ui::VerticalLayout*> container,
bool icon) {
const auto button = AddButtonWithLabel(
@@ -269,7 +270,7 @@ void SetupLanguageButton(
if ((m & Qt::ShiftModifier) && (m & Qt::AltModifier)) {
Lang::CurrentCloudManager().switchToLanguage({ u"#custom"_q });
} else {
*guard = LanguageBox::Show();
*guard = LanguageBox::Show(window->sessionController());
}
});
}
@@ -373,7 +374,7 @@ void SetupSections(
Calls::Id(),
{ &st::settingsIconCalls, kIconGreen });
SetupLanguageButton(container);
SetupLanguageButton(&controller->window(), container);
if (controller->session().premiumPossible()) {
AddSkip(container);