From 8dc4f8945e9ff6a2bfa71202da7338ca15121609 Mon Sep 17 00:00:00 2001 From: fourtf Date: Wed, 17 Jan 2018 03:26:32 +0100 Subject: [PATCH] fixes empty tooltips showing --- src/twitch/twitchmessagebuilder.cpp | 2 ++ src/widgets/helper/channelview.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/twitch/twitchmessagebuilder.cpp b/src/twitch/twitchmessagebuilder.cpp index f7f56361b..21367b2aa 100644 --- a/src/twitch/twitchmessagebuilder.cpp +++ b/src/twitch/twitchmessagebuilder.cpp @@ -163,6 +163,8 @@ MessagePtr TwitchMessageBuilder::parse() Link link; + qDebug() << linkString; + if (linkString.isEmpty()) { link = Link(); } else { diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index d02b285b0..6010c3fe8 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -632,9 +632,13 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) } const auto &tooltip = hoverLayoutElement->getCreator().getTooltip(); - tooltipWidget->moveTo(event->globalPos()); - tooltipWidget->setText(tooltip); - tooltipWidget->show(); + if (tooltip.isEmpty()) { + tooltipWidget->hide(); + } else { + tooltipWidget->moveTo(event->globalPos()); + tooltipWidget->setText(tooltip); + tooltipWidget->show(); + } // check if word has a link if (hoverLayoutElement->getCreator().getLink().isValid()) {