diff --git a/Telegram/Resources/icons/chat/input_autodelete_1d_ru.png b/Telegram/Resources/icons/chat/input_autodelete_1d_ru.png new file mode 100644 index 000000000..7a9d6f650 Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_1d_ru.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_1d_ru@2x.png b/Telegram/Resources/icons/chat/input_autodelete_1d_ru@2x.png new file mode 100644 index 000000000..ee33f2d76 Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_1d_ru@2x.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_1d_ru@3x.png b/Telegram/Resources/icons/chat/input_autodelete_1d_ru@3x.png new file mode 100644 index 000000000..568994ea3 Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_1d_ru@3x.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_30d_ru.png b/Telegram/Resources/icons/chat/input_autodelete_30d_ru.png new file mode 100644 index 000000000..138415b3f Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_30d_ru.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_30d_ru@2x.png b/Telegram/Resources/icons/chat/input_autodelete_30d_ru@2x.png new file mode 100644 index 000000000..8ee216c1e Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_30d_ru@2x.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_30d_ru@3x.png b/Telegram/Resources/icons/chat/input_autodelete_30d_ru@3x.png new file mode 100644 index 000000000..77ba43466 Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_30d_ru@3x.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_7d_ru.png b/Telegram/Resources/icons/chat/input_autodelete_7d_ru.png new file mode 100644 index 000000000..c4e563716 Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_7d_ru.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_7d_ru@2x.png b/Telegram/Resources/icons/chat/input_autodelete_7d_ru@2x.png new file mode 100644 index 000000000..330343b0a Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_7d_ru@2x.png differ diff --git a/Telegram/Resources/icons/chat/input_autodelete_7d_ru@3x.png b/Telegram/Resources/icons/chat/input_autodelete_7d_ru@3x.png new file mode 100644 index 000000000..cbabf3178 Binary files /dev/null and b/Telegram/Resources/icons/chat/input_autodelete_7d_ru@3x.png differ diff --git a/Telegram/SourceFiles/history/view/controls/history_view_ttl_button.cpp b/Telegram/SourceFiles/history/view/controls/history_view_ttl_button.cpp index 61ec114ed..26f8c1ce3 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_ttl_button.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_ttl_button.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_changes.h" #include "main/main_session.h" #include "lang/lang_keys.h" +#include "lang/lang_instance.h" #include "boxes/peers/edit_peer_info_box.h" #include "ui/boxes/auto_delete_settings.h" #include "ui/toast/toast.h" @@ -26,6 +27,46 @@ namespace { constexpr auto kToastDuration = crl::time(3500); +enum { + TTLIcon1 = 0, + TTLIcon1Over, + TTLIcon2, + TTLIcon2Over, + TTLIcon3, + TTLIcon3Over +}; + +QList defaultLangTTLIcons = { + nullptr, + nullptr, + &st::historyMessagesTTL2Icon, + &st::historyMessagesTTL2IconOver, + &st::historyMessagesTTL3Icon, + &st::historyMessagesTTL3IconOver +}; + +QList ruLangTTLIcons = { + &st::historyMessagesTTLRUIcon, + &st::historyMessagesTTLRUIconOver, + &st::historyMessagesTTLRU2Icon, + &st::historyMessagesTTLRU2IconOver, + &st::historyMessagesTTLRU3Icon, + &st::historyMessagesTTLRU3IconOver +}; + +const QList &TTLIconsList() { + const auto baseLang = Lang::GetInstance().baseId(); + const auto currentLang = Lang::Id(); + + for (const auto language : { "ru", "uk", "be" }) { + if (baseLang.startsWith(QLatin1String(language)) || currentLang == QString(language)) { + return ruLangTTLIcons; + } + } + + return defaultLangTTLIcons; +} + } // namespace void ShowAutoDeleteToast(not_null peer) { @@ -96,6 +137,9 @@ void AutoDeleteSettingsBox( TTLButton::TTLButton(not_null parent, not_null peer) : _peer(peer) , _button(parent, st::historyMessagesTTL) { + const auto iconsList = TTLIconsList(); + _button.setIconOverride(iconsList[TTLIcon1], iconsList[TTLIcon1Over]); + _button.setClickedCallback([=] { const auto canEdit = peer->isUser() || (peer->isChat() @@ -116,15 +160,11 @@ TTLButton::TTLButton(not_null parent, not_null peer) ) | rpl::start_with_next([=] { const auto ttl = peer->messagesTTL(); if (ttl < 2 * 86400) { - _button.setIconOverride(nullptr, nullptr); + _button.setIconOverride(iconsList[TTLIcon1], iconsList[TTLIcon1Over]); } else if (ttl < 8 * 86400) { - _button.setIconOverride( - &st::historyMessagesTTL2Icon, - &st::historyMessagesTTL2IconOver); + _button.setIconOverride(iconsList[TTLIcon2], iconsList[TTLIcon2Over]); } else { - _button.setIconOverride( - &st::historyMessagesTTL3Icon, - &st::historyMessagesTTL3IconOver); + _button.setIconOverride(iconsList[TTLIcon3], iconsList[TTLIcon3Over]); } }, _button.lifetime()); } diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index 99c9a7693..9991cc68e 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -319,6 +319,12 @@ historyMessagesTTL2Icon: icon {{ "chat/input_autodelete_7d", historyComposeIconF historyMessagesTTL2IconOver: icon {{ "chat/input_autodelete_7d", historyComposeIconFgOver }}; historyMessagesTTL3Icon: icon {{ "chat/input_autodelete_30d", historyComposeIconFg }}; historyMessagesTTL3IconOver: icon {{ "chat/input_autodelete_30d", historyComposeIconFgOver }}; +historyMessagesTTLRUIcon: icon {{ "chat/input_autodelete_1d_ru", historyComposeIconFg }}; +historyMessagesTTLRUIconOver: icon {{ "chat/input_autodelete_1d_ru", historyComposeIconFgOver }}; +historyMessagesTTLRU2Icon: icon {{ "chat/input_autodelete_7d_ru", historyComposeIconFg }}; +historyMessagesTTLRU2IconOver: icon {{ "chat/input_autodelete_7d_ru", historyComposeIconFgOver }}; +historyMessagesTTLRU3Icon: icon {{ "chat/input_autodelete_30d_ru", historyComposeIconFg }}; +historyMessagesTTLRU3IconOver: icon {{ "chat/input_autodelete_30d_ru", historyComposeIconFgOver }}; historyAttachEmojiFgActive: windowBgActive; historyAttachEmojiActive: icon {{ "chat/input_smile_face", historyAttachEmojiFgActive }}; historyAttachEmojiTooltipDelta: 4px;