Merge pull request #615 from LajamerrMittesdine/master
Fix QMenus from starting out of screen boundaries. Fixes #517 #571 #572
This commit is contained in:
@@ -1093,8 +1093,7 @@ void ChannelView::addContextMenuItems(const MessageLayoutElement *hoveredElement
|
|||||||
// // insert into input
|
// // insert into input
|
||||||
// });
|
// });
|
||||||
|
|
||||||
menu->move(QCursor::pos());
|
menu->popup(QCursor::pos());
|
||||||
menu->show();
|
|
||||||
menu->raise();
|
menu->raise();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -56,9 +56,7 @@ SplitHeader::SplitHeader(Split *_split)
|
|||||||
QTimer::singleShot(80, this, [&, this] {
|
QTimer::singleShot(80, this, [&, this] {
|
||||||
ChannelPtr _channel = this->split_->getChannel();
|
ChannelPtr _channel = this->split_->getChannel();
|
||||||
if (_channel->hasModRights()) {
|
if (_channel->hasModRights()) {
|
||||||
this->modeMenu_.move(
|
this->modeMenu_.popup(QCursor::pos());
|
||||||
this->modeButton_->mapToGlobal(QPoint(0, this->modeButton_->height())));
|
|
||||||
this->modeMenu_.show();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -83,9 +81,7 @@ SplitHeader::SplitHeader(Split *_split)
|
|||||||
this->addDropdownItems(dropdown.getElement());
|
this->addDropdownItems(dropdown.getElement());
|
||||||
QObject::connect(dropdown.getElement(), &RippleEffectButton::leftMousePress, this, [this] {
|
QObject::connect(dropdown.getElement(), &RippleEffectButton::leftMousePress, this, [this] {
|
||||||
QTimer::singleShot(80, [&, this] {
|
QTimer::singleShot(80, [&, this] {
|
||||||
this->dropdownMenu_.move(
|
this->dropdownMenu_.popup(QCursor::pos());
|
||||||
this->dropdownButton_->mapToGlobal(QPoint(0, this->dropdownButton_->height())));
|
|
||||||
this->dropdownMenu_.show();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user