diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 1220854033..57f7f3a9a8 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -4503,6 +4503,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_stickers_context_edit_name" = "Edit name"; "lng_stickers_context_delete" = "Delete sticker"; "lng_stickers_context_delete_sure" = "Are you sure you want to delete the sticker from your sticker set?"; +"lng_emoji_context_delete" = "Delete emoji"; +"lng_emoji_context_delete_sure" = "Are you sure you want to delete this emoji from your set?"; "lng_stickers_context_delete_pack" = "Delete Pack"; "lng_stickers_context_delete_pack_everyone" = "Delete for Everyone"; "lng_stickers_context_delete_pack_self" = "Delete for Myself"; diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index ed97954db8..acabd54ff7 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -976,10 +976,17 @@ void StickerSetBox::updateButtons() { top, st::popupMenuWithIcons); if (type == Data::StickersType::Emoji) { - (*menu)->addAction( - tr::lng_custom_emoji_remove_pack_button(tr::now), - remove, - &st::menuIconRemove); + if (fillSetCreatorMenu) { + fillSetCreatorMenu(*menu); + } + if (fillSetCreatorFooter) { + fillSetCreatorFooter(*menu); + } else { + (*menu)->addAction( + tr::lng_custom_emoji_remove_pack_button(tr::now), + remove, + &st::menuIconRemove); + } } else { if (fillSetCreatorMenu) { fillSetCreatorMenu(*menu); @@ -1137,7 +1144,8 @@ void StickerSetBox::Inner::applySet(const TLStickerSet &set) { & (SetFlag::Featured | SetFlag::NotLoaded | SetFlag::Unread - | SetFlag::Special); + | SetFlag::Special + | SetFlag::Installed); _setFlags |= clientFlags; set->flags = _setFlags; set->installDate = _setInstallDate; @@ -1611,6 +1619,19 @@ void StickerSetBox::Inner::contextMenuEvent(QContextMenuEvent *e) { Ui::Menu::CreateAddActionCallback(_menu.get()), _show, _pack[index]); + } else { + const auto addAction = Ui::Menu::CreateAddActionCallback( + _menu.get()); + addAction({ + .text = tr::lng_emoji_context_delete(tr::now), + .handler = [index, this, show = _show] { + show->showBox(Box([=](not_null box) { + fillDeleteStickerBox(box, index); + })); + }, + .icon = &st::menuIconDeleteAttention, + .isAttention = true, + }); } } else if (details.type != SendMenu::Type::Disabled) { const auto document = _pack[index]; @@ -1684,6 +1705,8 @@ void StickerSetBox::Inner::fillDeleteStickerBox( const auto document = _pack[index]; const auto weak = base::make_weak(this); const auto show = _show; + const auto type = setType(); + const auto isEmoji = (type == Data::StickersType::Emoji); const auto container = box->verticalLayout(); Ui::AddSkip(container); @@ -1718,7 +1741,9 @@ void StickerSetBox::Inner::fillDeleteStickerBox( }, sticker->lifetime()); const auto label = Ui::CreateChild( line, - tr::lng_stickers_context_delete(), + isEmoji + ? tr::lng_emoji_context_delete() + : tr::lng_stickers_context_delete(), box->getDelegate()->style().title); line->widthValue( ) | rpl::on_next([=](int width) { @@ -1742,7 +1767,9 @@ void StickerSetBox::Inner::fillDeleteStickerBox( box->addRow( object_ptr( container, - tr::lng_stickers_context_delete_sure(), + isEmoji + ? tr::lng_emoji_context_delete_sure() + : tr::lng_stickers_context_delete_sure(), st::boxLabel)); const auto save = [=] { if (state->requestId.current()) { @@ -1757,8 +1784,7 @@ void StickerSetBox::Inner::fillDeleteStickerBox( )).done([=](const TLStickerSet &result) { result.match([&](const MTPDmessages_stickerSet &d) { document->owner().stickers().feedSetFull(d); - document->owner().stickers().notifyUpdated( - Data::StickersType::Stickers); + document->owner().stickers().notifyUpdated(type); }, [](const auto &) { }); if ([[maybe_unused]] const auto strong = weak.get()) { diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index 52f10f5493..6a5d6f3693 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -2932,6 +2932,7 @@ void EmojiListWidget::refreshCustom() { return; } else if (valid) { i->thumbnailDocument = it->second->lookupThumbnailDocument(); + i->title = it->second->title; const auto premiumRequired = premium && premiumMayBeBought; if (i->canRemove != canRemove || i->premiumRequired != premiumRequired) { diff --git a/Telegram/SourceFiles/data/stickers/data_stickers.cpp b/Telegram/SourceFiles/data/stickers/data_stickers.cpp index 19a464be50..8c58d8cef9 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers.cpp +++ b/Telegram/SourceFiles/data/stickers/data_stickers.cpp @@ -1609,7 +1609,8 @@ not_null Stickers::feedSet(const MTPStickerSet &info) { & (SetFlag::Featured | SetFlag::Unread | SetFlag::NotLoaded - | SetFlag::Special); + | SetFlag::Special + | SetFlag::Installed); set->flags = flags | clientFlags; const auto installDate = data.vinstalled_date(); set->installDate = installDate