diff --git a/Telegram/Resources/icons/info_media_gif.png b/Telegram/Resources/icons/info_media_gif.png new file mode 100644 index 000000000..61fb6dad0 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..85220ed6a 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..781866f57 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 7224a9f72..b5ada1c51 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -862,6 +862,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_photos#one" = "{count} photo"; "lng_profile_photos#other" = "{count} photos"; "lng_profile_photos_header" = "Photos"; +"lng_profile_gifs#one" = "{count} GIF"; +"lng_profile_gifs#other" = "{count} GIFs"; +"lng_profile_gifs_header" = "GIFs"; "lng_profile_videos#one" = "{count} video"; "lng_profile_videos#other" = "{count} videos"; "lng_profile_videos_header" = "Videos"; @@ -904,6 +907,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_info_add_as_contact" = "Add to contacts"; "lng_profile_shared_media" = "Shared media"; "lng_media_type_photos" = "Photos"; +"lng_media_type_gifs" = "GIFs"; "lng_media_type_videos" = "Videos"; "lng_media_type_songs" = "Audio files"; "lng_media_type_files" = "Files"; @@ -923,6 +927,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_export_channel" = "Export channel history"; "lng_media_selected_photo#one" = "{count} Photo"; "lng_media_selected_photo#other" = "{count} Photos"; +"lng_media_selected_gif#one" = "{count} GIF"; +"lng_media_selected_gif#other" = "{count} GIFs"; "lng_media_selected_video#one" = "{count} Video"; "lng_media_selected_video#other" = "{count} Videos"; "lng_media_selected_song#one" = "{count} Audio file"; @@ -936,6 +942,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_media_selected_link#one" = "{count} Shared link"; "lng_media_selected_link#other" = "{count} Shared links"; "lng_media_photo_empty" = "No photos here yet"; +"lng_media_gif_empty" = "No GIFs here yet"; "lng_media_video_empty" = "No videos here yet"; "lng_media_song_empty" = "No music files here yet"; "lng_media_file_empty" = "No files here yet"; diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index e9b823a40..70fe83e08 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -349,6 +349,7 @@ infoIconNotifications: icon {{ "info_notifications", infoIconFg }}; infoIconActions: icon {{ "info_actions", 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 0cf05d4ba..fb0db3777 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -486,6 +486,7 @@ Ui::StringWithNumbers TopBar::generateSelectedText() const { const auto phrase = [&] { switch (_selectedItems.type) { case Type::Photo: return tr::lng_media_selected_photo; + case Type::GIF: return tr::lng_media_selected_gif; case Type::Video: return tr::lng_media_selected_video; case Type::File: return tr::lng_media_selected_file; case Type::MusicFile: return tr::lng_media_selected_song; @@ -580,6 +581,8 @@ rpl::producer TitleValue( switch (section.mediaType()) { case Section::MediaType::Photo: return tr::lng_media_type_photos(); + case Section::MediaType::GIF: + return tr::lng_media_type_gifs(); case Section::MediaType::Video: return tr::lng_media_type_videos(); case Section::MediaType::MusicFile: diff --git a/Telegram/SourceFiles/info/media/info_media_buttons.h b/Telegram/SourceFiles/info/media/info_media_buttons.h index 4e091e515..4b4b52cea 100644 --- a/Telegram/SourceFiles/info/media/info_media_buttons.h +++ b/Telegram/SourceFiles/info/media/info_media_buttons.h @@ -30,6 +30,7 @@ using Type = Storage::SharedMediaType; inline tr::phrase MediaTextPhrase(Type type) { switch (type) { case Type::Photo: return tr::lng_profile_photos; + case Type::GIF: return tr::lng_profile_gifs; case Type::Video: return tr::lng_profile_videos; case Type::File: return tr::lng_profile_files; case Type::MusicFile: return tr::lng_profile_songs; diff --git a/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp b/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp index cee74a857..a79cb821f 100644 --- a/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_empty_widget.cpp @@ -36,7 +36,8 @@ void EmptyWidget::setType(Type type) { _type = type; _icon = [&] { switch (_type) { - case Type::Photo: return &st::infoEmptyPhoto; + case Type::Photo: + case Type::GIF: return &st::infoEmptyPhoto; case Type::Video: return &st::infoEmptyVideo; case Type::MusicFile: return &st::infoEmptyAudio; case Type::File: return &st::infoEmptyFile; @@ -53,6 +54,8 @@ void EmptyWidget::setSearchQuery(const QString &query) { switch (_type) { case Type::Photo: return tr::lng_media_photo_empty(tr::now); + case Type::GIF: + return tr::lng_media_gif_empty(tr::now); case Type::Video: return tr::lng_media_video_empty(tr::now); case Type::MusicFile: diff --git a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp index 3ea25dddd..96db45a63 100644 --- a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp @@ -125,6 +125,7 @@ void InnerWidget::createTypeButtons() { addMediaButton(Type::MusicFile, st::infoIconMediaAudio); addMediaButton(Type::Link, st::infoIconMediaLink); addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice); + addMediaButton(Type::GIF, st::infoIconMediaGif); // if (auto user = _controller->key().peer()->asUser()) { // addCommonGroupsButton(user, st::infoIconMediaGroup); // } diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index 04768355d..7aea2918d 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -71,6 +71,7 @@ UniversalMsgId GetUniversalId(not_null layout) { bool HasFloatingHeader(Type type) { switch (type) { case Type::Photo: + case Type::GIF: case Type::Video: case Type::RoundFile: case Type::RoundVoiceFile: @@ -235,6 +236,7 @@ void ListWidget::Section::setHeader(not_null item) { auto date = item->dateTime().date(); switch (_type) { case Type::Photo: + case Type::GIF: case Type::Video: case Type::RoundFile: case Type::RoundVoiceFile: @@ -261,6 +263,7 @@ bool ListWidget::Section::belongsHere( switch (_type) { case Type::Photo: + case Type::GIF: case Type::Video: case Type::RoundFile: case Type::RoundVoiceFile: @@ -505,6 +508,7 @@ void ListWidget::Section::resizeToWidth(int newWidth) { }; switch (_type) { case Type::Photo: + case Type::GIF: case Type::Video: case Type::RoundFile: { _itemsLeft = st::infoMediaSkip; @@ -537,6 +541,7 @@ int ListWidget::Section::MinItemHeight(Type type, int width) { auto &songSt = st::overviewFileLayout; switch (type) { case Type::Photo: + case Type::GIF: case Type::Video: case Type::RoundFile: { auto itemsLeft = st::infoMediaSkip; @@ -562,6 +567,7 @@ int ListWidget::Section::recountHeight() const { switch (_type) { case Type::Photo: + case Type::GIF: case Type::Video: case Type::RoundFile: { auto itemHeight = _itemWidth + st::infoMediaSkip; @@ -966,6 +972,7 @@ std::unique_ptr ListWidget::createLayout( return std::make_unique(this, item, photo); } return nullptr; + case Type::GIF: case Type::Video: if (const auto file = getFile()) { return std::make_unique