From fe75a9f0b7d0f42d7ab83982a70c7cd0ba08f7d5 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Mon, 3 Feb 2020 08:12:47 +0300 Subject: [PATCH] Added "disable Up to edit" to options menu --- Telegram/Resources/langs/lang.strings | 2 ++ Telegram/Resources/langs/rewrites/ru.json | 1 + Telegram/SourceFiles/settings/settings_kotato.cpp | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index e24b97df6..b9cee9486 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2313,6 +2313,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_settings_sticker_height" = "Sticker height: {pixels}px"; "ktg_settings_emoji_outline" = "Big emoji outline"; +"ktg_settings_disable_up_edit" = "Disable edit by Up key"; + "ktg_settings_always_show_scheduled" = "Always show scheduled"; "ktg_settings_chat_list_compact" = "Compact chat list"; diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index 9ff12d8a4..40384b1ee 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -50,6 +50,7 @@ "ktg_settings_chats": "Чаты", "ktg_settings_sticker_height": "Высота стикеров: {pixels} пикс.", "ktg_settings_emoji_outline": "Обводка у больших эмодзи", + "ktg_settings_disable_up_edit": "Отключить редактирование по «Вверх»", "ktg_settings_always_show_scheduled": "Всегда показывать отложенные", "ktg_settings_chat_list_compact": "Компактный список чатов", "ktg_fonts_title": "Шрифты", diff --git a/Telegram/SourceFiles/settings/settings_kotato.cpp b/Telegram/SourceFiles/settings/settings_kotato.cpp index b15206cff..549eebe6a 100644 --- a/Telegram/SourceFiles/settings/settings_kotato.cpp +++ b/Telegram/SourceFiles/settings/settings_kotato.cpp @@ -126,6 +126,20 @@ void SetupKotatoChats(not_null container) { KotatoSettings::Write(); }, container->lifetime()); + AddButton( + container, + tr::ktg_settings_disable_up_edit(), + st::settingsButton + )->toggleOn( + rpl::single(cDisableUpEdit()) + )->toggledValue( + ) | rpl::filter([](bool enabled) { + return (enabled != cDisableUpEdit()); + }) | rpl::start_with_next([](bool enabled) { + cSetDisableUpEdit(enabled); + KotatoSettings::Write(); + }, container->lifetime()); + AddButton( container, tr::ktg_settings_fonts(),