Merge pull request #677 from 23rd/patch-4-link-tooltip-bttv

Added tooltip to links.
This commit is contained in:
pajlada
2018-08-29 01:23:17 +02:00
committed by GitHub
10 changed files with 90 additions and 4 deletions
+5 -1
View File
@@ -861,11 +861,15 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
return;
}
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
bool isLinkValid = hoverLayoutElement->getLink().isValid();
if (tooltip.isEmpty()) {
tooltipWidget->hide();
} else if (isLinkValid && !getSettings()->enableLinkInfoTooltip) {
tooltipWidget->hide();
} else {
tooltipWidget->moveTo(this, event->globalPos());
tooltipWidget->setWordWrap(isLinkValid);
tooltipWidget->setText(tooltip);
tooltipWidget->adjustSize();
tooltipWidget->show();
@@ -873,7 +877,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
}
// check if word has a link
if (hoverLayoutElement->getLink().isValid()) {
if (isLinkValid) {
this->setCursor(Qt::PointingHandCursor);
} else {
this->setCursor(Qt::ArrowCursor);