diff --git a/Telegram/Resources/icons/info_media_gif.png b/Telegram/Resources/icons/info_media_gif.png new file mode 100644 index 000000000..4451f2ffd Binary files /dev/null and b/Telegram/Resources/icons/info_media_gif.png differ diff --git a/Telegram/Resources/icons/info_media_gif@2x.png b/Telegram/Resources/icons/info_media_gif@2x.png new file mode 100644 index 000000000..91adfd386 Binary files /dev/null and b/Telegram/Resources/icons/info_media_gif@2x.png differ diff --git a/Telegram/Resources/icons/info_media_gif@3x.png b/Telegram/Resources/icons/info_media_gif@3x.png new file mode 100644 index 000000000..784c99723 Binary files /dev/null and b/Telegram/Resources/icons/info_media_gif@3x.png differ diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 9d1142980..b15eba5dc 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2559,4 +2559,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_too_many_accounts_warning" = "Warning! Using too many accounts at the same time is not recommended due to higher memory comsumption and possible crashes because of it.\n\nYou sure you want to add a new account?"; "ktg_account_add_anyway" = "Add anyway"; +"ktg_media_selected_gif#one" = "{count} GIF"; +"ktg_media_selected_gif#other" = "{count} GIFs"; +"ktg_media_type_gif" = "GIFs"; +"ktg_profile_gif#one" = "{count} GIF"; +"ktg_profile_gif#other" = "{count} GIFs"; +"ktg_media_gif_empty" = "No GIFs here yet"; + // Keys finished diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index 987edec63..a759a4637 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -149,5 +149,19 @@ "ktg_group_status_owner": "вы владелец", "ktg_group_status_admin": "вы админ", "ktg_too_many_accounts_warning": "Внимание! Использование слишком большого количества аккаунтов одновременно не рекомендуется из-за высокого потребления памяти, а также возможных вылетов из-за этого.\n\nВы точно хотите добавить новый аккаунт?", - "ktg_account_add_anyway": "Всё равно добавить" + "ktg_account_add_anyway": "Всё равно добавить", + "ktg_media_selected_gif": { + "one": "{count} GIF", + "few": "{count} GIF", + "many": "{count} GIF", + "other": "{count} GIF" + }, + "ktg_media_type_gif": "GIF", + "ktg_profile_gif": { + "one": "{count} GIF", + "few": "{count} GIF", + "many": "{count} GIF", + "other": "{count} GIF" + }, + "ktg_media_gif_empty": "Здесь пока нет GIF" } diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 7b6089319..6df3dd78c 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -354,6 +354,7 @@ infoIconActions: icon {{ "info_actions", infoIconFg }}; //infoIconFeed: icon {{ "info_feed", infoIconFg }}; infoIconMediaPhoto: icon {{ "info_media_photo", infoIconFg }}; infoIconMediaVideo: icon {{ "info_media_video", infoIconFg }}; +infoIconMediaGif: icon {{ "info_media_gif", infoIconFg }}; infoIconMediaFile: icon {{ "info_media_file", infoIconFg }}; infoIconMediaAudio: icon {{ "info_media_audio", infoIconFg }}; infoIconMediaLink: icon {{ "info_media_link", infoIconFg }}; diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index d01846258..d4d38fe6e 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -487,6 +487,7 @@ Ui::StringWithNumbers TopBar::generateSelectedText() const { switch (_selectedItems.type) { case Type::Photo: return tr::lng_media_selected_photo; case Type::Video: return tr::lng_media_selected_video; + case Type::GIF: return tr::ktg_media_selected_gif; case Type::File: return tr::lng_media_selected_file; case Type::MusicFile: return tr::lng_media_selected_song; case Type::Link: return tr::lng_media_selected_link; @@ -583,6 +584,8 @@ rpl::producer TitleValue( return tr::lng_media_type_photos(); case Section::MediaType::Video: return tr::lng_media_type_videos(); + case Section::MediaType::GIF: + return tr::ktg_media_type_gif(); case Section::MediaType::MusicFile: return tr::lng_media_type_songs(); case Section::MediaType::File: diff --git a/Telegram/SourceFiles/info/media/info_media_buttons.h b/Telegram/SourceFiles/info/media/info_media_buttons.h index eaf2154ad..972ec046c 100644 --- a/Telegram/SourceFiles/info/media/info_media_buttons.h +++ b/Telegram/SourceFiles/info/media/info_media_buttons.h @@ -31,6 +31,7 @@ inline tr::phrase MediaTextPhrase(Type type) { switch (type) { case Type::Photo: return tr::lng_profile_photos; case Type::Video: return tr::lng_profile_videos; + case Type::GIF: return tr::ktg_profile_gif; case Type::File: return tr::lng_profile_files; case Type::MusicFile: return tr::lng_profile_songs; case Type::Link: return tr::lng_profile_shared_links; diff --git a/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp b/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp index cee74a857..0f47032a6 100644 --- a/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp @@ -38,6 +38,7 @@ void EmptyWidget::setType(Type type) { switch (_type) { case Type::Photo: return &st::infoEmptyPhoto; case Type::Video: return &st::infoEmptyVideo; + case Type::GIF: return &st::infoEmptyVideo; case Type::MusicFile: return &st::infoEmptyAudio; case Type::File: return &st::infoEmptyFile; case Type::Link: return &st::infoEmptyLink; @@ -55,6 +56,8 @@ void EmptyWidget::setSearchQuery(const QString &query) { return tr::lng_media_photo_empty(tr::now); case Type::Video: return tr::lng_media_video_empty(tr::now); + case Type::GIF: + return tr::ktg_media_gif_empty(tr::now); case Type::MusicFile: return query.isEmpty() ? tr::lng_media_song_empty(tr::now) diff --git a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp index d76a43575..0644f53e9 100644 --- a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp @@ -121,6 +121,7 @@ void InnerWidget::createTypeButtons() { addMediaButton(Type::Photo, st::infoIconMediaPhoto); addMediaButton(Type::Video, st::infoIconMediaVideo); + addMediaButton(Type::GIF, st::infoIconMediaGif); addMediaButton(Type::File, st::infoIconMediaFile); addMediaButton(Type::MusicFile, st::infoIconMediaAudio); addMediaButton(Type::Link, st::infoIconMediaLink); diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index 7ad029129..6c34b7647 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -213,6 +213,7 @@ void ListWidget::Section::setHeader(not_null item) { switch (_type) { case Type::Photo: case Type::Video: + case Type::GIF: case Type::RoundFile: case Type::RoundVoiceFile: case Type::File: @@ -239,6 +240,7 @@ bool ListWidget::Section::belongsHere( switch (_type) { case Type::Photo: case Type::Video: + case Type::GIF: case Type::RoundFile: case Type::RoundVoiceFile: case Type::File: @@ -464,6 +466,7 @@ void ListWidget::Section::resizeToWidth(int newWidth) { switch (_type) { case Type::Photo: case Type::Video: + case Type::GIF: case Type::RoundFile: { _itemsLeft = st::infoMediaSkip; _itemsTop = st::infoMediaSkip; @@ -496,6 +499,7 @@ int ListWidget::Section::MinItemHeight(Type type, int width) { switch (type) { case Type::Photo: case Type::Video: + case Type::GIF: case Type::RoundFile: { auto itemsLeft = st::infoMediaSkip; auto itemsInRow = (width - itemsLeft) @@ -521,6 +525,7 @@ int ListWidget::Section::recountHeight() const { switch (_type) { case Type::Photo: case Type::Video: + case Type::GIF: case Type::RoundFile: { auto itemHeight = _itemWidth + st::infoMediaSkip; auto index = 0; @@ -905,6 +910,7 @@ std::unique_ptr ListWidget::createLayout( } return nullptr; case Type::Video: + case Type::GIF: if (const auto file = getFile()) { return std::make_unique