# HG changeset patch
# User displacer
# Date 1217871058 0
# Node ID 0bc17a69b3d816a91529af4e2d220d95116e09bb
# Parent ec5073ceb4886876780ec5ef68f50606965131fc
Background for Hedgewars is ready
diff -r ec5073ceb488 -r 0bc17a69b3d8 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Mon Aug 04 17:09:31 2008 +0000
+++ b/QTfrontend/hedgewars.qrc Mon Aug 04 17:30:58 2008 +0000
@@ -19,5 +19,12 @@
res/bonus.png
res/Hedgehog.svg
res/net.png
+ res/About.png
+ res/Background.png
+ res/Exit.png
+ res/HedgewarsTitle.png
+ res/LocalPlay.png
+ res/Network play.png
+ res/Settings.png
diff -r ec5073ceb488 -r 0bc17a69b3d8 QTfrontend/main.cpp
--- a/QTfrontend/main.cpp Mon Aug 04 17:09:31 2008 +0000
+++ b/QTfrontend/main.cpp Mon Aug 04 17:30:58 2008 +0000
@@ -23,6 +23,8 @@
#include
#include
#include
+#include
+
#include "hwform.h"
#include "hwconsts.h"
@@ -51,6 +53,27 @@
Q_INIT_RESOURCE(hedgewars);
+ QString imgAddr=":/res/Background.png";
+ QImage bgrndIm(imgAddr);
+ QRect deskSz=qApp->desktop()->screenGeometry();
+ bgrndIm=bgrndIm.scaled(deskSz.width()-deskSz.left(), deskSz.height()-deskSz.top(),
+ Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ if (bgrndIm.save(QDir::tempPath()+"/hedgewarsScaledBgrnd.png")) {
+ imgAddr=QDir::tempPath()+"/hedgewarsScaledBgrnd.png";
+ }
+
+ qApp->setStyleSheet
+ (QString(
+ ".HWForm{"
+ "background-image: url(\"%1\");"
+ "background-position: bottom center;"
+ //" background-origin: content;"
+ //"background-repeat: no-repeat;"
+ //"background-color: black;"
+ "}"
+ ).arg(imgAddr)
+ );
+
bindir->cd("bin"); // workaround over NSIS installer
cfgdir->setPath(cfgdir->homePath());