fixes empty tooltips showing

This commit is contained in:
fourtf 2018-01-17 03:26:32 +01:00
parent 776a975624
commit 8dc4f8945e
2 changed files with 9 additions and 3 deletions

View file

@ -163,6 +163,8 @@ MessagePtr TwitchMessageBuilder::parse()
Link link; Link link;
qDebug() << linkString;
if (linkString.isEmpty()) { if (linkString.isEmpty()) {
link = Link(); link = Link();
} else { } else {

View file

@ -632,9 +632,13 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
} }
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip(); const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
tooltipWidget->moveTo(event->globalPos()); if (tooltip.isEmpty()) {
tooltipWidget->setText(tooltip); tooltipWidget->hide();
tooltipWidget->show(); } else {
tooltipWidget->moveTo(event->globalPos());
tooltipWidget->setText(tooltip);
tooltipWidget->show();
}
// check if word has a link // check if word has a link
if (hoverLayoutElement->getCreator().getLink().isValid()) { if (hoverLayoutElement->getCreator().getLink().isValid()) {