From df97d609a2dab16c50514f130578b6d30206a15d Mon Sep 17 00:00:00 2001 From: fanway <23499543+fanway@users.noreply.github.com> Date: Fri, 9 Oct 2020 18:21:04 +0300 Subject: [PATCH] Fix tooltip not showing in `EmotePopup` (#2046) * Fix tooltip not showing in `EmotePopup` * Update CHANGELOG.md --- CHANGELOG.md | 1 + src/widgets/helper/ChannelView.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 325ba5ca..8e20fb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Bugfix: Starting Chatterino in a minimized state after an update will no longer cause a crash - Bugfix: Modify the emote parsing to handle some edge-cases with dots and stuff (#1704, #1714) - Bugfix: Fixed timestamps being incorrect on some messages loaded from the recent-messages service on startup (#1286, #2020) +- Bugfix: Fixed tooltip didn't show in `EmotePopup` depending on the `Link preview` setting enabled or no (#2008) ## 2.2.0 diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 76e18594..4a3ccf7d 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1273,12 +1273,11 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) const auto &tooltip = hoverLayoutElement->getCreator().getTooltip(); bool isLinkValid = hoverLayoutElement->getLink().isValid(); + auto emoteElement = + dynamic_cast(&hoverLayoutElement->getCreator()); - if (tooltip.isEmpty()) - { - tooltipWidget->hide(); - } - else if (isLinkValid && !getSettings()->linkInfoTooltip) + if (tooltip.isEmpty() || (isLinkValid && emoteElement == nullptr && + !getSettings()->linkInfoTooltip)) { tooltipWidget->hide(); } @@ -1286,8 +1285,6 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) { auto &tooltipPreviewImage = TooltipPreviewImage::instance(); tooltipPreviewImage.setImageScale(0, 0); - auto emoteElement = dynamic_cast( - &hoverLayoutElement->getCreator()); auto badgeElement = dynamic_cast( &hoverLayoutElement->getCreator());