Allow each layered image to retain its own flags (#4460)

This fixes an issue where context-menu items for zero-width emotes displayed the wrong provider.
This commit is contained in:
nerix
2023-03-19 11:26:30 +01:00
committed by GitHub
parent 0acbc0d2c3
commit a777a227d4
6 changed files with 58 additions and 29 deletions
+3 -3
View File
@@ -1710,7 +1710,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
for (size_t i = 0; i < upperLimit; ++i)
{
auto &emote = layeredEmotes[i];
const auto &emote = layeredEmotes[i].ptr;
if (i == 0)
{
// First entry gets a large image and full description
@@ -2202,10 +2202,10 @@ void ChannelView::addImageContextMenuItems(
// Give each emote its own submenu
for (auto &emote : layeredElement->getUniqueEmotes())
{
auto emoteAction = menu.addAction(emote->name.string);
auto emoteAction = menu.addAction(emote.ptr->name.string);
auto emoteMenu = new QMenu(&menu);
emoteAction->setMenu(emoteMenu);
addEmoteContextMenuItems(*emote, creatorFlags, *emoteMenu);
addEmoteContextMenuItems(*emote.ptr, emote.flags, *emoteMenu);
}
}
}