opening user info popup approx. at the center of the mouse

This commit is contained in:
fourtf 2018-06-19 19:51:08 +02:00
parent b2be44bbe7
commit 7e53b44099
2 changed files with 5 additions and 2 deletions

View file

@ -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);

View file

@ -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();
}