From aa9f3fe9fa57bad10f03ffc6d7defd492724ca46 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 8 Oct 2015 15:53:20 +0200 Subject: fix msgBox not beeing properly centered --- src/pwgui/main.cpp | 6 ++++-- 1 file 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 #include #include +#include #include #include #include @@ -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(); -- cgit v1.2.3-55-g7522