fix(windows): show split tooltip before move (#5230)

This commit is contained in:
nerix
2024-03-09 11:27:42 +01:00
committed by GitHub
parent 26bb4e236d
commit ecad4b052a
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -950,13 +950,27 @@ void SplitHeader::enterEvent(QEvent *event)
this->tooltipWidget_->setOne({nullptr, this->tooltipText_});
this->tooltipWidget_->setWordWrap(true);
this->tooltipWidget_->adjustSize();
// On Windows, a lot of the resizing/activating happens when calling
// show() and calling it doesn't synchronously create a visible window,
// so moving the window won't cause the visible window to jump.
//
// On other platforms, this isn't the case, hence we call show() after
// moving.
#ifdef Q_OS_WIN
this->tooltipWidget_->show();
#endif
auto pos =
this->mapToGlobal(this->rect().bottomLeft()) +
QPoint((this->width() - this->tooltipWidget_->width()) / 2, 1);
this->tooltipWidget_->moveTo(pos,
widgets::BoundsChecking::CursorPosition);
#ifndef Q_OS_WIN
this->tooltipWidget_->show();
#endif
}
BaseWidget::enterEvent(event);