# HG changeset patch
# User koda
# Date 1356624062 -3600
# Node ID bf237f7f1d94f43957cc650ee68c5694900d6583
# Parent bc948db1273a634665e6e8f3c8ecacba4d8e19a1
add a splashscreen while the main interface is loading (enabled on all platforms, disable if it doesn'n't look good
diff -r bc948db1273a -r bf237f7f1d94 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Thu Dec 27 15:56:02 2012 +0100
+++ b/QTfrontend/hedgewars.qrc Thu Dec 27 17:01:02 2012 +0100
@@ -146,6 +146,7 @@
res/chat/serveradmin_gray.png
res/chat/lamp_off.png
res/chat/ingame.png
- res/html/about.html
+ res/splash.png
+ res/html/about.html
diff -r bc948db1273a -r bf237f7f1d94 QTfrontend/main.cpp
--- a/QTfrontend/main.cpp Thu Dec 27 15:56:02 2012 +0100
+++ b/QTfrontend/main.cpp Thu Dec 27 17:01:02 2012 +0100
@@ -27,6 +27,8 @@
#include
#include
#include
+#include
+#include
#include "hwform.h"
#include "hwconsts.h"
@@ -136,6 +138,19 @@
HWApplication app(argc, argv);
+ QLabel *splash = NULL;
+#ifdef Q_WS_WIN | Q_WS_X11 | Q_WS_MAC //enabled on all platforms, disable if it doesn't look good
+ QPixmap pixmap(":res/splash.png");
+ splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
+ splash->setAttribute(Qt::WA_TranslucentBackground);
+ const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
+ QPoint splashCenter = QPoint( (deskSize.width() - pixmap.width())/2,
+ (deskSize.height() - pixmap.height())/2 );
+ splash->move(splashCenter);
+ splash->setPixmap(pixmap);
+ splash->show();
+#endif
+
FileEngineHandler engine(argv[0]);
app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
@@ -305,6 +320,7 @@
break;
default :
fname = "qt.css";
+ break;
}
// load external stylesheet if there is any
@@ -319,5 +335,7 @@
app.form = new HWForm(NULL, style);
app.form->show();
+ if(splash)
+ splash->close();
return app.exec();
}
diff -r bc948db1273a -r bf237f7f1d94 QTfrontend/res/splash.png
Binary file QTfrontend/res/splash.png has changed
diff -r bc948db1273a -r bf237f7f1d94 misc/winutils/Hedgewars.lnk
Binary file misc/winutils/Hedgewars.lnk has changed