summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2015-10-08 15:53:20 +0200
committerJonathan Bauer2015-10-08 15:53:20 +0200
commitaa9f3fe9fa57bad10f03ffc6d7defd492724ca46 (patch)
tree4cfbfe4e14f6d8ab79ca8685a58db2212479278c
parentmove msgBox closer to center :) TOFIX (diff)
downloadprintergui-aa9f3fe9fa57bad10f03ffc6d7defd492724ca46.tar.gz
printergui-aa9f3fe9fa57bad10f03ffc6d7defd492724ca46.tar.xz
printergui-aa9f3fe9fa57bad10f03ffc6d7defd492724ca46.zip
fix msgBox not beeing properly centered
-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();