# HG changeset patch # User unc0rr # Date 1225464000 0 # Node ID e79e4b48c771d94f3f635f87bd3d46a57999f6e3 # Parent ef9785d0b3928586b514be47d2c73828d5c3921a Reorganize single player menu diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/hedgewars.qrc --- a/QTfrontend/hedgewars.qrc Fri Oct 31 14:35:59 2008 +0000 +++ b/QTfrontend/hedgewars.qrc Fri Oct 31 14:40:00 2008 +0000 @@ -20,6 +20,9 @@ res/Hedgehog.svg res/net.png res/About.png + res/SimpleGame.png + res/Multiplayer.png + res/Trainings.png res/Background.png res/Exit.png res/HedgewarsTitle.png @@ -31,6 +34,7 @@ res/unchecked.png res/graphicsicon.png res/Save.png + res/Record.png res/weaponsicon.png res/teamicon.png res/panelbg.png diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Fri Oct 31 14:35:59 2008 +0000 +++ b/QTfrontend/pages.cpp Fri Oct 31 14:40:00 2008 +0000 @@ -101,7 +101,8 @@ pageLayout->addWidget(tbw, 0, 0, 1, 3); BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 1, 0, true); BtnTeamSave = addButton(":/res/Save.png", pageLayout, 1, 2, true);; - + BtnTeamSave->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); + QHBoxLayout * page1Layout = new QHBoxLayout(page1); page1Layout->setAlignment(Qt::AlignTop); QGridLayout * page2Layout = new QGridLayout(page2); @@ -371,6 +372,7 @@ GBAfpslayout->addWidget(fpsedit); BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 4, 2, true); + BtnSaveOptions->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true); } @@ -589,20 +591,24 @@ PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent) { QFont * font14 = new QFont("MS Shell Dlg", 14); - QGridLayout * pageLayout = new QGridLayout(this); -// pageLayout->setColumnStretch(0, 1); -// pageLayout->setColumnStretch(1, 2); -// pageLayout->setColumnStretch(2, 1); - pageLayout->setRowStretch(0, 1); - pageLayout->setRowStretch(6, 1); + QVBoxLayout * vLayout = new QVBoxLayout(this); + QHBoxLayout * topLine = new QHBoxLayout(); + QHBoxLayout * middleLine = new QHBoxLayout(); + QHBoxLayout * bottomLine = new QHBoxLayout(); + vLayout->addLayout(topLine); + vLayout->addLayout(middleLine); + vLayout->addLayout(bottomLine); - BtnSimpleGamePage = addButton(tr("Simple Game"), pageLayout, 1, 1); - BtnTrainPage = addButton(tr("Training"), pageLayout, 2, 1); - BtnMultiplayer = addButton(tr("Multiplayer"), pageLayout, 3, 1); - BtnLoad = addButton(tr("Saved games"), pageLayout, 4, 1); - BtnDemos = addButton(tr("Demos"), pageLayout, 5, 1); - - BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true); + BtnSimpleGamePage = addButton(":/res/SimpleGame.png", topLine, 0, true); + BtnMultiplayer = addButton(":/res/Multiplayer.png", topLine, 1, true); +// pageLayout->setAlignment(BtnSinglePlayer, Qt::AlignHCenter); + BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 0, true); + + BtnBack = addButton(":/res/Exit.png", bottomLine, 0, true); + BtnDemos = addButton(tr(":/res/Record.png"), bottomLine, 1, true); + + BtnLoad = addButton(":/res/Save.png", bottomLine, 2, true); + BtnLoad->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); } PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent) @@ -633,6 +639,7 @@ BtnDefault = addButton(tr("Default"), pageLayout, 1, 1); BtnDelete = addButton(tr("Delete"), pageLayout, 1, 2); BtnSave = addButton(":/res/Save.png", pageLayout, 1, 3, true); + BtnSave->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); } PageInGame::PageInGame(QWidget* parent) : diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/pages.h --- a/QTfrontend/pages.h Fri Oct 31 14:35:59 2008 +0000 +++ b/QTfrontend/pages.h Fri Oct 31 14:40:00 2008 +0000 @@ -72,10 +72,6 @@ } else { const QIcon& lp=QIcon(btname); QSize sz = lp.actualSize(QSize(65535, 65535)); - if (btname == ":/res/Save.png") - { - butt->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); - } butt->setIcon(lp); butt->setFixedSize(sz); butt->setIconSize(sz); @@ -104,10 +100,20 @@ return butt; }; - QPushButton* addButton(QString btname, QBoxLayout* box, int where) { + QPushButton* addButton(QString btname, QBoxLayout* box, int where, bool iconed = false) { QPushButton* butt = new QPushButton(this); - butt->setFont(*font14); - butt->setText(btname); + if (!iconed) { + butt->setFont(*font14); + butt->setText(btname); + } else { + const QIcon& lp=QIcon(btname); + QSize sz = lp.actualSize(QSize(65535, 65535)); + butt->setIcon(lp); + butt->setFixedSize(sz); + butt->setIconSize(sz); + butt->setFlat(true); + butt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + } box->addWidget(butt, where); return butt; }; diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/res/Multiplayer.png Binary file QTfrontend/res/Multiplayer.png has changed diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/res/Record.png Binary file QTfrontend/res/Record.png has changed diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/res/SimpleGame.png Binary file QTfrontend/res/SimpleGame.png has changed diff -r ef9785d0b392 -r e79e4b48c771 QTfrontend/res/Trainings.png Binary file QTfrontend/res/Trainings.png has changed