mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +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,
|
not_null<Ui::PopupMenu*> menu,
|
||||||
int section,
|
int section,
|
||||||
int index) {
|
int index) {
|
||||||
if (section != int(Section::Recent)) {
|
const auto recent = (section == int(Section::Recent));
|
||||||
return;
|
|
||||||
}
|
|
||||||
const auto addAction = Ui::Menu::CreateAddActionCallback(menu);
|
const auto addAction = Ui::Menu::CreateAddActionCallback(menu);
|
||||||
const auto over = OverEmoji{ section, index };
|
const auto over = OverEmoji{ section, index };
|
||||||
const auto emoji = lookupOverEmoji(&over);
|
const auto emoji = lookupOverEmoji(&over);
|
||||||
|
@ -1157,18 +1155,21 @@ void EmojiListWidget::fillRecentMenu(
|
||||||
TextUtilities::SetClipboardText(data);
|
TextUtilities::SetClipboardText(data);
|
||||||
}, &st::menuIconCopy);
|
}, &st::menuIconCopy);
|
||||||
}
|
}
|
||||||
if (setId && _features.openStickerSets) {
|
if (recent && setId && _features.openStickerSets) {
|
||||||
addAction(
|
addAction(
|
||||||
tr::lng_emoji_view_pack(tr::now),
|
tr::lng_emoji_view_pack(tr::now),
|
||||||
crl::guard(this, [=] { displaySet(setId); }),
|
crl::guard(this, [=] { displaySet(setId); }),
|
||||||
&st::menuIconShowAll);
|
&st::menuIconShowAll);
|
||||||
}
|
}
|
||||||
} else if (emoji) {
|
} else if (recent && emoji) {
|
||||||
addAction(tr::lng_emoji_copy(tr::now), [=] {
|
addAction(tr::lng_emoji_copy(tr::now), [=] {
|
||||||
const auto text = emoji->text();
|
const auto text = emoji->text();
|
||||||
TextUtilities::SetClipboardText({ text, { text } });
|
TextUtilities::SetClipboardText({ text, { text } });
|
||||||
}, &st::menuIconCopy);
|
}, &st::menuIconCopy);
|
||||||
}
|
}
|
||||||
|
if (!recent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto id = RecentEmojiId{ emoji };
|
auto id = RecentEmojiId{ emoji };
|
||||||
if (custom) {
|
if (custom) {
|
||||||
id.data = RecentEmojiDocument{
|
id.data = RecentEmojiDocument{
|
||||||
|
@ -1194,7 +1195,7 @@ void EmojiListWidget::fillRecentMenu(
|
||||||
.confirmed = crl::guard(this, sure),
|
.confirmed = crl::guard(this, sure),
|
||||||
.confirmText = tr::lng_emoji_reset_recent_button(tr::now),
|
.confirmText = tr::lng_emoji_reset_recent_button(tr::now),
|
||||||
.labelStyle = &st().boxLabel,
|
.labelStyle = &st().boxLabel,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
addAction({
|
addAction({
|
||||||
.text = tr::lng_emoji_reset_recent(tr::now),
|
.text = tr::lng_emoji_reset_recent(tr::now),
|
||||||
|
|
Loading…
Add table
Reference in a new issue