# 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 @@ <file>res/bonus.png</file> <file>res/Hedgehog.svg</file> <file>res/net.png</file> + <file>res/About.png</file> + <file>res/Background.png</file> + <file>res/Exit.png</file> + <file>res/HedgewarsTitle.png</file> + <file>res/LocalPlay.png</file> + <file>res/Network play.png</file> + <file>res/Settings.png</file> </qresource> </RCC> 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 <QFileInfo> #include <QDateTime> #include <QTextStream> +#include <QDesktopWidget> + #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());