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;
|
||||
}
|
||||
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
|
||||
bool isLinkValid = hoverLayoutElement->getLink().isValid();
|
||||
|
||||
if (tooltip.isEmpty()) {
|
||||
tooltipWidget->hide();
|
||||
} else if (hoverLayoutElement->getLink().isValid() && !getSettings()->enableLinkInfoTooltip) {
|
||||
} else if (isLinkValid && !getSettings()->enableLinkInfoTooltip) {
|
||||
tooltipWidget->hide();
|
||||
} else {
|
||||
tooltipWidget->moveTo(this, event->globalPos());
|
||||
tooltipWidget->setWordWrap(hoverLayoutElement->getLink().isValid());
|
||||
tooltipWidget->setWordWrap(isLinkValid);
|
||||
tooltipWidget->setText(tooltip);
|
||||
tooltipWidget->adjustSize();
|
||||
tooltipWidget->show();
|
||||
|
@ -876,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);
|
||||
|
|
Loading…
Reference in a new issue