mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Allow copy custom emoji from panel.
This commit is contained in:
parent
cedd8fc546
commit
74db2167f9
1 changed files with 7 additions and 6 deletions
|
@ -1134,9 +1134,7 @@ void EmojiListWidget::fillRecentMenu(
|
|||
not_null<Ui::PopupMenu*> menu,
|
||||
int section,
|
||||
int index) {
|
||||
if (section != int(Section::Recent)) {
|
||||
return;
|
||||
}
|
||||
const auto recent = (section == int(Section::Recent));
|
||||
const auto addAction = Ui::Menu::CreateAddActionCallback(menu);
|
||||
const auto over = OverEmoji{ section, index };
|
||||
const auto emoji = lookupOverEmoji(&over);
|
||||
|
@ -1157,18 +1155,21 @@ void EmojiListWidget::fillRecentMenu(
|
|||
TextUtilities::SetClipboardText(data);
|
||||
}, &st::menuIconCopy);
|
||||
}
|
||||
if (setId && _features.openStickerSets) {
|
||||
if (recent && setId && _features.openStickerSets) {
|
||||
addAction(
|
||||
tr::lng_emoji_view_pack(tr::now),
|
||||
crl::guard(this, [=] { displaySet(setId); }),
|
||||
&st::menuIconShowAll);
|
||||
}
|
||||
} else if (emoji) {
|
||||
} else if (recent && emoji) {
|
||||
addAction(tr::lng_emoji_copy(tr::now), [=] {
|
||||
const auto text = emoji->text();
|
||||
TextUtilities::SetClipboardText({ text, { text } });
|
||||
}, &st::menuIconCopy);
|
||||
}
|
||||
if (!recent) {
|
||||
return;
|
||||
}
|
||||
auto id = RecentEmojiId{ emoji };
|
||||
if (custom) {
|
||||
id.data = RecentEmojiDocument{
|
||||
|
@ -1194,7 +1195,7 @@ void EmojiListWidget::fillRecentMenu(
|
|||
.confirmed = crl::guard(this, sure),
|
||||
.confirmText = tr::lng_emoji_reset_recent_button(tr::now),
|
||||
.labelStyle = &st().boxLabel,
|
||||
}));
|
||||
}));
|
||||
};
|
||||
addAction({
|
||||
.text = tr::lng_emoji_reset_recent(tr::now),
|
||||
|
|
Loading…
Add table
Reference in a new issue