mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
chore: improve appearance of Twitch emotes in popup (#5632)
This commit is contained in:
parent
64864a0901
commit
3e2116629a
3 changed files with 23 additions and 19 deletions
|
@ -49,7 +49,7 @@
|
|||
- Bugfix: Fixed splits staying paused after unfocusing Chatterino in certain configurations. (#5504, #5637)
|
||||
- Bugfix: Links with invalid characters in the domain are no longer detected. (#5509)
|
||||
- Bugfix: Fixed janky selection for messages with RTL segments (selection is still wrong, but consistently wrong). (#5525)
|
||||
- Bugfix: Fixed event emotes not showing up in autocomplete and popups. (#5239, #5580, #5582)
|
||||
- Bugfix: Fixed event emotes not showing up in autocomplete and popups. (#5239, #5580, #5582, #5632)
|
||||
- Bugfix: Fixed tab visibility being controllable in the emote popup. (#5530)
|
||||
- Bugfix: Fixed account switch not being saved if no other settings were changed. (#5558)
|
||||
- Bugfix: Fixed some tooltips not being readable. (#5578)
|
||||
|
|
|
@ -494,17 +494,14 @@ TwitchEmoteSetMeta getTwitchEmoteSetMeta(const HelixChannelEmote &emote)
|
|||
return u"x-c2-globals"_s;
|
||||
}
|
||||
|
||||
if (!emote.setID.isEmpty())
|
||||
// some bit emote-sets have an id, but we want to combine them into a
|
||||
// single set
|
||||
if (isBits)
|
||||
{
|
||||
return emote.setID;
|
||||
return TWITCH_BIT_EMOTE_SET_PREFIX % emote.ownerID;
|
||||
}
|
||||
|
||||
if (isSub)
|
||||
{
|
||||
return TWITCH_SUB_EMOTE_SET_PREFIX % emote.ownerID;
|
||||
}
|
||||
// isBits
|
||||
return TWITCH_BIT_EMOTE_SET_PREFIX % emote.ownerID;
|
||||
// isSub
|
||||
return TWITCH_SUB_EMOTE_SET_PREFIX % emote.ownerID;
|
||||
}();
|
||||
|
||||
return {
|
||||
|
|
|
@ -136,25 +136,32 @@ void addTwitchEmoteSets(const std::shared_ptr<const EmoteMap> &local,
|
|||
MessageElementFlag::TwitchEmote);
|
||||
}
|
||||
|
||||
// Put current channel emotes at the top
|
||||
std::vector<
|
||||
std::pair<QString, std::reference_wrapper<const TwitchEmoteSet>>>
|
||||
sortedSets;
|
||||
sortedSets.reserve(sets->size());
|
||||
for (const auto &[_id, set] : *sets)
|
||||
{
|
||||
if (set.owner->id == currentChannelID)
|
||||
{
|
||||
// Put current channel emotes at the top
|
||||
addEmotes(subChannel, set.emotes, set.title(),
|
||||
MessageElementFlag::TwitchEmote);
|
||||
}
|
||||
else
|
||||
{
|
||||
sortedSets.emplace_back(set.title(), std::cref(set));
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto &[id, set] : *sets)
|
||||
{
|
||||
if (set.owner->id == currentChannelID)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::ranges::sort(sortedSets, [](const auto &a, const auto &b) {
|
||||
return a.first.compare(b.first, Qt::CaseInsensitive) < 0;
|
||||
});
|
||||
|
||||
addEmotes(set.isSubLike ? subChannel : globalChannel, set.emotes,
|
||||
set.title(), MessageElementFlag::TwitchEmote);
|
||||
for (const auto &[title, set] : sortedSets)
|
||||
{
|
||||
addEmotes(set.get().isSubLike ? subChannel : globalChannel,
|
||||
set.get().emotes, title, MessageElementFlag::TwitchEmote);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue