diff --git a/CHANGELOG.md b/CHANGELOG.md index ecb8f536c..c56ac5e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ - Minor: Updated to Emoji v15.1. Google emojis are now used as the fallback instead of Twitter emojis. (#5182) - Minor: Allow theming of tab live and rerun indicators. (#5188) - Minor: Added a fallback theme field to custom themes that will be used in case the custom theme does not contain a color Chatterino needs. If no fallback theme is specified, we'll pull the color from the included Dark or Light theme. (#5198) +- Minor: Image links now reflect the scale of their image instead of an internal label. (#5201) - Bugfix: Fixed an issue where certain emojis did not send to Twitch chat correctly. (#4840) - Bugfix: Fixed capitalized channel names in log inclusion list not being logged. (#4848) - Bugfix: Trimmed custom streamlink paths on all platforms making sure you don't accidentally add spaces at the beginning or end of its path. (#4834) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 6b293235f..47f3e3faa 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -87,24 +87,31 @@ void addEmoteContextMenuItems(QMenu *menu, const Emote &emote, auto *copyMenu = new QMenu(menu); copyAction->setMenu(copyMenu); - // Add copy and open links for 1x, 2x, 3x - auto addImageLink = [&](const ImagePtr &image, char scale) { + // Scale of the smallest image + std::optional baseScale; + // Add copy and open links for images + auto addImageLink = [&](const ImagePtr &image) { if (!image->isEmpty()) { - copyMenu->addAction("&" + QString(scale) + "x link", - [url = image->url()] { - crossPlatformCopy(url.string); - }); - openMenu->addAction("&" + QString(scale) + "x link", - [url = image->url()] { - QDesktopServices::openUrl(QUrl(url.string)); - }); + if (!baseScale) + { + baseScale = image->scale(); + } + + auto factor = + QString::number(static_cast(*baseScale / image->scale())); + copyMenu->addAction("&" + factor + "x link", [url = image->url()] { + crossPlatformCopy(url.string); + }); + openMenu->addAction("&" + factor + "x link", [url = image->url()] { + QDesktopServices::openUrl(QUrl(url.string)); + }); } }; - addImageLink(emote.images.getImage1(), '1'); - addImageLink(emote.images.getImage2(), '2'); - addImageLink(emote.images.getImage3(), '3'); + addImageLink(emote.images.getImage1()); + addImageLink(emote.images.getImage2()); + addImageLink(emote.images.getImage3()); // Copy and open emote page link auto addPageLink = [&](const QString &name) {