Iconed "Back" button everywhere
authorunc0rr
Tue, 05 Aug 2008 21:12:26 +0000
changeset 1153 825931b81ad4
parent 1152 c72b939c00df
child 1154 03cc0ab9c013
Iconed "Back" button everywhere
QTfrontend/main.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
QTfrontend/playrecordpage.cpp
QTfrontend/playrecordpage.h
--- a/QTfrontend/main.cpp	Tue Aug 05 20:57:08 2008 +0000
+++ b/QTfrontend/main.cpp	Tue Aug 05 21:12:26 2008 +0000
@@ -61,17 +61,20 @@
 				"background-repeat: repeat-x;"
 				"background-color: #870c8f;"
 				"}"
-				"PageMain > QPushButton{"
+//				"PageMain > QPushButton{"
+				"QPushButton{"
 				"border: solid;"
 				"border-width: 4px;"
 				"border-radius: 8px;"
 				"border-color: orange;"
 				"background-origin: content;"
 				"}"
-				"PageMain > QPushButton:hover{"
+//				"PageMain > QPushButton:hover{"
+				"QPushButton:hover{"
 				"border-color: yellow;"
 				"}"
-				"PageMain > QPushButton:pressed{"
+//				"PageMain > QPushButton:pressed{"
+				"QPushButton:pressed{"
 				"border-color: white;"
 				"}"
 			)
--- a/QTfrontend/pages.cpp	Tue Aug 05 20:57:08 2008 +0000
+++ b/QTfrontend/pages.cpp	Tue Aug 05 21:12:26 2008 +0000
@@ -117,7 +117,7 @@
 	}
 	pageLayout->addWidget(GBoxHedgehogs, 1, 0, 2, 1);
 
-	BtnTeamDiscard = addButton(tr("Discard"), pageLayout, 4, 0);
+	BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
 
 	GBoxBinds = new QGroupBox(this);
 	GBoxBinds->setTitle(QGroupBox::tr("Key binds"));
@@ -245,7 +245,7 @@
 {
 	QGridLayout * pageLayout = new QGridLayout(this);
 
-	BtnBack = addButton(tr("Back"), pageLayout, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	gameCFG = new GameCFGWidget(this);
 	pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
@@ -331,7 +331,7 @@
 
 	BtnSaveOptions = addButton(tr("Save"), pageLayout, 4, 2);
 
-	BtnBack = addButton(tr("Back"), pageLayout, 4, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
 
 	QGroupBox* groupWeapons = new QGroupBox(this);
 	groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -360,7 +360,7 @@
 	GBNlayout->addWidget(editNetNick, 0, 1);
 }
 
-PageNet::PageNet(QWidget* parent) : QWidget(parent)
+PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -414,10 +414,7 @@
 	BtnSpecifyServer->setText(QPushButton::tr("Specify"));
 	GBClayout->addWidget(BtnSpecifyServer, 2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 3, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true);
 
 	connect(rbLocalGame, SIGNAL(toggled(bool)), this, SLOT(updateServersList()));
 	connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect()));
@@ -453,7 +450,7 @@
 	emit connectClicked(host, port);
 }
 
-PageNetServer::PageNetServer(QWidget* parent) : QWidget(parent)
+PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -464,10 +461,7 @@
 	pageLayout->setRowStretch(0, 1);
 	pageLayout->setRowStretch(1, 0);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack =addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	BtnStart = new QPushButton(this);
 	BtnStart->setFont(*font14);
@@ -518,7 +512,7 @@
 	sbPort->setValue(46631);
 }
 
-PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent)
+PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -540,10 +534,7 @@
 	pNetTeamsWidget->setAcceptOuter(true);
 	pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 2, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true);
 
 	BtnGo = new QPushButton(this);
 	BtnGo->setFont(*font14);
@@ -552,7 +543,7 @@
 	pageLayout->addWidget(BtnGo, 2, 1);
 }
 
-PageInfo::PageInfo(QWidget* parent) : QWidget(parent)
+PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -560,16 +551,13 @@
 	pageLayout->setColumnStretch(1, 1);
 	pageLayout->setColumnStretch(2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	about = new About(this);
 	pageLayout->addWidget(about, 0, 0, 1, 3);
 }
 
-PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent)
+PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -577,10 +565,7 @@
 	pageLayout->setColumnStretch(1, 1);
 	pageLayout->setColumnStretch(2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	labelGameStats = new QLabel(this);
 	labelGameStats->setTextFormat(Qt::RichText);
@@ -604,10 +589,10 @@
 	BtnLoad = addButton(tr("Saved games"), pageLayout, 4, 1);
 	BtnDemos = addButton(tr("Demos"), pageLayout, 5, 1);
 
-	BtnBack = addButton(tr("Back"), pageLayout, 7, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true);
 }
 
-PageTraining::PageTraining(QWidget* parent) : QWidget(parent)
+PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -621,10 +606,7 @@
 	BtnStartTrain->setText(QPushButton::tr("Go!"));
 	pageLayout->addWidget(BtnStartTrain, 1, 2);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 }
 
 PageSelectWeapon::PageSelectWeapon(QWidget* parent) :
--- a/QTfrontend/pages.h	Tue Aug 05 20:57:08 2008 +0000
+++ b/QTfrontend/pages.h	Tue Aug 05 21:12:26 2008 +0000
@@ -201,7 +201,7 @@
 	QLineEdit *editNetNick;
 };
 
-class PageNet : public QWidget
+class PageNet : public AbstractPage
 {
 	Q_OBJECT
 
@@ -231,7 +231,7 @@
 	void connectClicked(const QString & host, quint16 port);
 };
 
-class PageNetServer : public QWidget
+class PageNetServer : public AbstractPage
 {
 	Q_OBJECT
 
@@ -250,7 +250,7 @@
 	void setDefaultPort();
 };
 
-class PageNetGame : public QWidget
+class PageNetGame : public AbstractPage
 {
 	Q_OBJECT
 
@@ -266,7 +266,7 @@
 	GameCFGWidget* pGameCFG;
 };
 
-class PageInfo : public QWidget
+class PageInfo : public AbstractPage
 {
 	Q_OBJECT
 
@@ -277,7 +277,7 @@
 	About *about;
 };
 
-class PageGameStats : public QWidget
+class PageGameStats : public AbstractPage
 {
 	Q_OBJECT
 
@@ -304,7 +304,7 @@
 	GameCFGWidget *gameCFG;
 };
 
-class PageTraining : public QWidget
+class PageTraining : public AbstractPage
 {
 	Q_OBJECT
 
--- a/QTfrontend/playrecordpage.cpp	Tue Aug 05 20:57:08 2008 +0000
+++ b/QTfrontend/playrecordpage.cpp	Tue Aug 05 21:12:26 2008 +0000
@@ -28,7 +28,7 @@
 #include "hwconsts.h"
 #include "playrecordpage.h"
 
-PagePlayDemo::PagePlayDemo(QWidget* parent) : QWidget(parent)
+PagePlayDemo::PagePlayDemo(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -37,10 +37,7 @@
 	pageLayout->setColumnStretch(2, 1);
 	pageLayout->setRowStretch(2, 100);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 3, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true);
 
 	BtnPlayDemo = new QPushButton(this);
 	BtnPlayDemo->setFont(*font14);
--- a/QTfrontend/playrecordpage.h	Tue Aug 05 20:57:08 2008 +0000
+++ b/QTfrontend/playrecordpage.h	Tue Aug 05 21:12:26 2008 +0000
@@ -19,13 +19,14 @@
 #ifndef PLAYRECORDPAGE_H
 #define PLAYRECORDPAGE_H
 
-#include <QWidget>
 #include <QDir>
 
+#include "pages.h"
+
 class QPushButton;
 class QListWidget;
 
-class PagePlayDemo : public QWidget
+class PagePlayDemo : public AbstractPage
 {
 	Q_OBJECT