From 52cd9f8cbf4c19eca9a05278dc0cc578ac31847b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 18 Jul 2020 19:19:34 +0300 Subject: [PATCH] Fixed handling of language switch for checkboxes in intro settings. --- .../settings/settings_advanced.cpp | 28 +++++++++++-------- Telegram/lib_ui | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/settings/settings_advanced.cpp b/Telegram/SourceFiles/settings/settings_advanced.cpp index c14f71217..ccdb94209 100644 --- a/Telegram/SourceFiles/settings/settings_advanced.cpp +++ b/Telegram/SourceFiles/settings/settings_advanced.cpp @@ -326,23 +326,27 @@ void SetupSpellchecker( } void SetupSystemIntegrationContent(not_null container) { - const auto checkbox = [&](const QString &label, bool checked) { + const auto checkbox = [&](rpl::producer &&label, bool checked) { return object_ptr( container, - label, + std::move(label), checked, st::settingsCheckbox); }; - const auto addCheckbox = [&](const QString &label, bool checked) { + const auto addCheckbox = [&]( + rpl::producer &&label, + bool checked) { return container->add( - checkbox(label, checked), + checkbox(std::move(label), checked), st::settingsCheckboxPadding); }; - const auto addSlidingCheckbox = [&](const QString &label, bool checked) { + const auto addSlidingCheckbox = [&]( + rpl::producer &&label, + bool checked) { return container->add( object_ptr>( container, - checkbox(label, checked), + checkbox(std::move(label), checked), st::settingsCheckboxPadding)); }; if (Platform::TrayIconSupported()) { @@ -352,7 +356,7 @@ void SetupSystemIntegrationContent(not_null container) { || (workMode == dbiwmWindowAndTray); }; const auto tray = addCheckbox( - tr::lng_settings_workmode_tray(tr::now), + tr::lng_settings_workmode_tray(), trayEnabled()); const auto taskbarEnabled = [] { @@ -362,7 +366,7 @@ void SetupSystemIntegrationContent(not_null container) { }; const auto taskbar = Platform::IsWindows() ? addCheckbox( - tr::lng_settings_workmode_window(tr::now), + tr::lng_settings_workmode_window(), taskbarEnabled()) : nullptr; @@ -406,7 +410,7 @@ void SetupSystemIntegrationContent(not_null container) { } if (Platform::AllowNativeWindowFrameToggle()) { const auto nativeFrame = addCheckbox( - tr::lng_settings_native_frame(tr::now), + tr::lng_settings_native_frame(), Core::App().settings().nativeWindowFrame()); nativeFrame->checkedChanges( @@ -423,10 +427,10 @@ void SetupSystemIntegrationContent(not_null container) { }; const auto autostart = addCheckbox( - tr::lng_settings_auto_start(tr::now), + tr::lng_settings_auto_start(), cAutoStart()); const auto minimized = addSlidingCheckbox( - tr::lng_settings_start_min(tr::now), + tr::lng_settings_start_min(), minimizedToggled()); autostart->checkedChanges( @@ -468,7 +472,7 @@ void SetupSystemIntegrationContent(not_null container) { if (Platform::IsWindows() && !Platform::IsWindowsStoreBuild()) { const auto sendto = addCheckbox( - tr::lng_settings_add_sendto(tr::now), + tr::lng_settings_add_sendto(), cSendToMenu()); sendto->checkedChanges( diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 34eb5a8eb..697f2851b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 34eb5a8eb802dbbf9e5c9516e55a04af6b87aeb2 +Subproject commit 697f2851b0625ae784e405e7fc596d1629e8668a