--- a/QTfrontend/util/MessageDialog.cpp Sat Jun 14 15:49:44 2014 +0200
+++ b/QTfrontend/util/MessageDialog.cpp Sat Jun 14 23:59:20 2014 +0200
@@ -19,6 +19,8 @@
#include "MessageDialog.h"
#include "HWApplication.h"
+
+
int MessageDialog::ShowFatalMessage(const QString & msg, QWidget * parent)
{
return ShowMessage(QMessageBox::tr("Hedgewars - Error"),
@@ -51,5 +53,20 @@
msgMsg.setIcon(icon);
msgMsg.setWindowModality(Qt::WindowModal);
+ if (!parent)
+ {
+ try
+ {
+ /* workaround to make sure style is correct
+ * I'd rather assign the stylesheet to qApp directly (in main.cpp),
+ * but the current Stylesheet will ruin the look (e.g. map selection) :(
+ */
+ HWApplication * app = dynamic_cast<HWApplication*>(HWApplication::instance());
+ if (app->form)
+ msgMsg.setStyleSheet(app->form->styleSheet());
+ }
+ catch (...) { /* nothing */ }
+ }
+
return msgMsg.exec();
}