Fix tooltip & popup positioning (#4740)

* Fix tooltip & popup positioning

This tries to ensure the tooltip & popups are created on the correct
monitor

* Add changelog entry

* Clean up debug output

* Use the full frame geometry to figure out screen bound movements

* Remove the now-unused `setStayInScreenRect` function

* Change the UserInfoPopup offset to be based on its width & height
instead

* Remove more debug output
This commit is contained in:
pajlada
2023-08-05 13:22:37 +02:00
committed by GitHub
parent b98be3b0f3
commit 9e2eb0dd29
11 changed files with 63 additions and 54 deletions
+3 -2
View File
@@ -206,8 +206,9 @@ EmotePopup::EmotePopup(QWidget *parent)
, search_(new QLineEdit())
, notebook_(new Notebook(this))
{
this->setStayInScreenRect(true);
this->moveTo(this, getApp()->windows->emotePopupPos(), false);
// this->setStayInScreenRect(true);
this->moveTo(getApp()->windows->emotePopupPos(), false,
BaseWindow::BoundsChecker::DesiredPosition);
auto *layout = new QVBoxLayout();
this->getLayoutContainer()->setLayout(layout);
-1
View File
@@ -29,7 +29,6 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, QWidget *parent,
, split_(split)
{
this->setWindowTitle(QStringLiteral("Reply Thread"));
this->setStayInScreenRect(true);
HotkeyController::HotkeyMap actions{
{"delete",
-4
View File
@@ -142,7 +142,6 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
assert(split != nullptr &&
"split being nullptr causes lots of bugs down the road");
this->setWindowTitle("Usercard");
this->setStayInScreenRect(true);
HotkeyController::HotkeyMap actions{
{"delete",
@@ -715,9 +714,6 @@ void UserInfoPopup::setData(const QString &name,
this->userStateChanged_.invoke();
this->updateLatestMessages();
QTimer::singleShot(1, this, [this] {
this->setStayInScreenRect(true);
});
}
void UserInfoPopup::updateLatestMessages()
@@ -46,7 +46,6 @@ QuickSwitcherPopup::QuickSwitcherPopup(QWidget *parent)
this->initWidgets();
this->setStayInScreenRect(true);
const QRect geom = parent->geometry();
// This places the popup in the middle of the parent widget
this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter,