From 7e53b4409956da7389dd8ee28164234e62028d5b Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 19 Jun 2018 19:51:08 +0200 Subject: [PATCH] opening user info popup approx. at the center of the mouse --- src/widgets/helper/channelview.cpp | 4 +++- src/widgets/split.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index c93909d5b..6b43760ce 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -1149,10 +1149,12 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const messages::Link &link switch (link.type) { case messages::Link::UserInfo: { auto user = link.value; + auto *userPopup = new UserInfoPopup; userPopup->setData(user, this->channel_); userPopup->setAttribute(Qt::WA_DeleteOnClose); - userPopup->move(event->globalPos()); + userPopup->move(QCursor::pos() - + QPoint(int(150 * this->getScale()), int(70 * this->getScale()))); userPopup->show(); // this->userPopupWidget.setName(user); diff --git a/src/widgets/split.cpp b/src/widgets/split.cpp index f4ea1ae5b..a38922c08 100644 --- a/src/widgets/split.cpp +++ b/src/widgets/split.cpp @@ -506,7 +506,8 @@ void Split::doOpenUserInfoPopup(const QString &user) auto *userPopup = new UserInfoPopup; userPopup->setData(user, this->getChannel()); userPopup->setAttribute(Qt::WA_DeleteOnClose); - userPopup->move(QCursor::pos()); + userPopup->move(QCursor::pos() - + QPoint(int(150 * this->getScale()), int(70 * this->getScale()))); userPopup->show(); }