set the gravity to center the dialog.
size it off the minSize which is already calculated, not off the size() with is nto
This commit is contained in:
parent
e07ea84865
commit
8269fc2b39
1 changed files with 3 additions and 2 deletions
|
@ -133,11 +133,12 @@ void MessageDialog::show()
|
||||||
r = Rect(Point(0, 0), display->screenInfo(screen())->size());
|
r = Rect(Point(0, 0), display->screenInfo(screen())->size());
|
||||||
|
|
||||||
XSizeHints size;
|
XSizeHints size;
|
||||||
size.flags = PMinSize | PPosition;
|
size.flags = PMinSize | PPosition | PWinGravity;
|
||||||
size.min_width = minSize().width();
|
size.min_width = minSize().width();
|
||||||
size.min_height = minSize().height();
|
size.min_height = minSize().height();
|
||||||
|
size.win_gravity = CenterGravity;
|
||||||
|
|
||||||
Size dest = area().size();
|
Size dest = minSize();
|
||||||
if (dest.width() < 200 || dest.height() < 100) {
|
if (dest.width() < 200 || dest.height() < 100) {
|
||||||
if (dest.width() < 200 && dest.height() < 100) dest = Size(200, 100);
|
if (dest.width() < 200 && dest.height() < 100) dest = Size(200, 100);
|
||||||
else if (dest.width() < 200) dest = Size(200, dest.height());
|
else if (dest.width() < 200) dest = Size(200, dest.height());
|
||||||
|
|
Loading…
Reference in a new issue