diff options
author | Jonathan Bauer | 2015-10-07 15:21:58 +0200 |
---|---|---|
committer | Jonathan Bauer | 2015-10-07 15:21:58 +0200 |
commit | a37b794467d3991ccecf84442ae9bfead8dc9b5f (patch) | |
tree | 45a0fbe24ce42fa844e3726fba1dd94d90cd41d1 | |
parent | [pwgui] Actually execute the message box after creating it... (diff) | |
download | printergui-a37b794467d3991ccecf84442ae9bfead8dc9b5f.tar.gz printergui-a37b794467d3991ccecf84442ae9bfead8dc9b5f.tar.xz printergui-a37b794467d3991ccecf84442ae9bfead8dc9b5f.zip |
move msgBox closer to center :) TOFIX
-rw-r--r-- | src/pwgui/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp index 9a8dd36..edd594c 100644 --- a/src/pwgui/main.cpp +++ b/src/pwgui/main.cpp @@ -2,6 +2,7 @@ #include "config.h" #include <QApplication> #include <QMessageBox> +#include <QDesktopWidget> #include <cups/backend.h> #include <fcntl.h> #include <sys/stat.h> @@ -570,12 +571,15 @@ static void helper_messageBox(const char *caption, const char *text, const bool QMessageBox msgBox; msgBox.setWindowTitle(QString::fromUtf8(caption)); msgBox.setText(QString::fromUtf8(text)); - msgBox.setWindowFlags(Qt::WindowStaysOnTopHint); + msgBox.setWindowFlags(Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); if (error) { msgBox.setIcon(QMessageBox::Critical); } else { msgBox.setIcon(QMessageBox::Information); } + QRect desktopRect = QApplication::desktop()->screenGeometry(); + msgBox.move(desktopRect.width()/2-msgBox.width()/2, + desktopRect.height()/2-msgBox.height()/2); msgBox.show(); msgBox.showNormal(); msgBox.raise(); |