mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Adjust size before first show so as to not overflow.
This commit is contained in:
parent
0599da9859
commit
ea30497527
1 changed files with 4 additions and 1 deletions
|
|
@ -31,9 +31,12 @@ void SettingsButtonWidget::togglePopup()
|
||||||
if (popup->isVisible()) {
|
if (popup->isVisible()) {
|
||||||
popup->close();
|
popup->close();
|
||||||
} else {
|
} else {
|
||||||
|
// Ensure popup size is known before positioning
|
||||||
|
popup->adjustSize();
|
||||||
|
QSize popupSize = popup->size();
|
||||||
|
|
||||||
// Get button position
|
// Get button position
|
||||||
QPoint buttonGlobalPos = button->mapToGlobal(QPoint(0, button->height()));
|
QPoint buttonGlobalPos = button->mapToGlobal(QPoint(0, button->height()));
|
||||||
QSize popupSize = popup->size();
|
|
||||||
|
|
||||||
// Get screen geometry
|
// Get screen geometry
|
||||||
QScreen *screen = QApplication::screenAt(buttonGlobalPos);
|
QScreen *screen = QApplication::screenAt(buttonGlobalPos);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue