mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Put isValid() in variable.
This commit is contained in:
parent
f8c42918a6
commit
539d8c20d2
1 changed files with 4 additions and 3 deletions
|
@ -861,14 +861,15 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
|
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
|
||||||
|
bool isLinkValid = hoverLayoutElement->getLink().isValid();
|
||||||
|
|
||||||
if (tooltip.isEmpty()) {
|
if (tooltip.isEmpty()) {
|
||||||
tooltipWidget->hide();
|
tooltipWidget->hide();
|
||||||
} else if (hoverLayoutElement->getLink().isValid() && !getSettings()->enableLinkInfoTooltip) {
|
} else if (isLinkValid && !getSettings()->enableLinkInfoTooltip) {
|
||||||
tooltipWidget->hide();
|
tooltipWidget->hide();
|
||||||
} else {
|
} else {
|
||||||
tooltipWidget->moveTo(this, event->globalPos());
|
tooltipWidget->moveTo(this, event->globalPos());
|
||||||
tooltipWidget->setWordWrap(hoverLayoutElement->getLink().isValid());
|
tooltipWidget->setWordWrap(isLinkValid);
|
||||||
tooltipWidget->setText(tooltip);
|
tooltipWidget->setText(tooltip);
|
||||||
tooltipWidget->adjustSize();
|
tooltipWidget->adjustSize();
|
||||||
tooltipWidget->show();
|
tooltipWidget->show();
|
||||||
|
@ -876,7 +877,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if word has a link
|
// check if word has a link
|
||||||
if (hoverLayoutElement->getLink().isValid()) {
|
if (isLinkValid) {
|
||||||
this->setCursor(Qt::PointingHandCursor);
|
this->setCursor(Qt::PointingHandCursor);
|
||||||
} else {
|
} else {
|
||||||
this->setCursor(Qt::ArrowCursor);
|
this->setCursor(Qt::ArrowCursor);
|
||||||
|
|
Loading…
Reference in a new issue