mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fix build with Xcode.
This commit is contained in:
parent
57ecd918f1
commit
8383caa2b5
3 changed files with 17 additions and 5 deletions
|
@ -2727,9 +2727,9 @@ void StickersListWidget::removeMegagroupSet(bool locally) {
|
|||
}
|
||||
close();
|
||||
}),
|
||||
.cancelled = crl::guard(this, [this](Fn<void()> &&close) {
|
||||
.cancelled = [](Fn<void()> &&close) {
|
||||
close();
|
||||
}),
|
||||
},
|
||||
})));
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ struct RecentEmojiDocument {
|
|||
struct RecentEmojiId {
|
||||
std::variant<EmojiPtr, RecentEmojiDocument> data;
|
||||
|
||||
friend inline auto operator<=>(
|
||||
friend inline bool operator==(
|
||||
RecentEmojiId,
|
||||
RecentEmojiId) = default;
|
||||
};
|
||||
|
|
|
@ -258,13 +258,25 @@ void AppendFavedStickers(
|
|||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] EmojiPack RecentEmojiSection() {
|
||||
const auto list = Core::App().settings().recentEmoji();
|
||||
auto result = EmojiPack();
|
||||
result.reserve(list.size());
|
||||
for (const auto &emoji : list) {
|
||||
if (const auto one = std::get_if<EmojiPtr>(&emoji.id.data)) {
|
||||
result.push_back(*one);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void AppendEmojiPacks(
|
||||
const Data::StickersSets &sets,
|
||||
std::vector<PickerScrubberItem> &to) {
|
||||
for (auto i = 0; i != ChatHelpers::kEmojiSectionCount; ++i) {
|
||||
const auto section = static_cast<Ui::Emoji::Section>(i);
|
||||
const auto list = (section == Ui::Emoji::Section::Recent)
|
||||
? Core::App().settings().recentEmojiSection()
|
||||
? RecentEmojiSection()
|
||||
: Ui::Emoji::GetSection(section);
|
||||
const auto title = (section == Ui::Emoji::Section::Recent)
|
||||
? TitleRecentlyUsed(sets)
|
||||
|
@ -475,7 +487,7 @@ void AppendEmojiPacks(
|
|||
if (const auto inputField = qobject_cast<QTextEdit*>(
|
||||
QApplication::focusWidget())) {
|
||||
Ui::InsertEmojiAtCursor(inputField->textCursor(), emoji);
|
||||
Core::App().settings().incrementRecentEmoji(emoji);
|
||||
Core::App().settings().incrementRecentEmoji({ emoji });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue