summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pwgui/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index edd594c..9f6bfae 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -3,6 +3,7 @@
#include <QApplication>
#include <QMessageBox>
#include <QDesktopWidget>
+#include <QLayout>
#include <cups/backend.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -578,8 +579,9 @@ static void helper_messageBox(const char *caption, const char *text, const bool
msgBox.setIcon(QMessageBox::Information);
}
QRect desktopRect = QApplication::desktop()->screenGeometry();
- msgBox.move(desktopRect.width()/2-msgBox.width()/2,
- desktopRect.height()/2-msgBox.height()/2);
+ QSize msgBoxSize = msgBox.sizeHint();
+ msgBox.move(desktopRect.width()/2-msgBoxSize.width()/2,
+ desktopRect.height()/2-msgBoxSize.height()/2);
msgBox.show();
msgBox.showNormal();
msgBox.raise();