QTfrontend/pages.cpp
changeset 1150 ae86e36dad2e
parent 1149 c2d3b4f71836
child 1151 ee6573db301a
equal deleted inserted replaced
1149:c2d3b4f71836 1150:ae86e36dad2e
    53 
    53 
    54 PageMain::PageMain(QWidget* parent) : 
    54 PageMain::PageMain(QWidget* parent) : 
    55   AbstractPage(parent)
    55   AbstractPage(parent)
    56 {
    56 {
    57 	QGridLayout * pageLayout = new QGridLayout(this);
    57 	QGridLayout * pageLayout = new QGridLayout(this);
    58 	pageLayout->setMargin(25);
    58 	//pageLayout->setMargin(25);
    59 	//pageLayout->setColumnStretch(0, 1);
    59 	//pageLayout->setColumnStretch(0, 1);
    60 	//pageLayout->setColumnStretch(1, 2);
    60 	//pageLayout->setColumnStretch(1, 2);
    61 	//pageLayout->setColumnStretch(2, 1);
    61 	//pageLayout->setColumnStretch(2, 1);
    62 
    62 
    63 	QPushButton* btnLogo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, QSize(780, 176));
    63 	QPushButton* btnLogo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, QSize(720, 140));
    64 	pageLayout->setAlignment(btnLogo, Qt::AlignCenter);
    64 	pageLayout->setAlignment(btnLogo, Qt::AlignHCenter);
    65 	pageLayout->setRowStretch(0, 1);
    65 	pageLayout->setRowStretch(0, 1);
    66 	pageLayout->setRowStretch(1, 100);
    66 	pageLayout->setRowStretch(1, 1);
    67 	pageLayout->setRowStretch(2, 1);
    67 	pageLayout->setRowStretch(2, 0);
    68 
    68 	pageLayout->setRowStretch(3, 1);
    69 	BtnSinglePlayer = addButton(":/res/LocalPlay.png", pageLayout, 1, 0, 1, 2, QSize(314, 289));
    69 
    70 	pageLayout->setAlignment(BtnSinglePlayer, Qt::AlignCenter);
    70 	BtnSinglePlayer = addButton(":/res/LocalPlay.png", pageLayout, 2, 0, 1, 2, QSize(314, 260));
    71 
    71 	pageLayout->setAlignment(BtnSinglePlayer, Qt::AlignHCenter);
    72 	BtnMultiplayer = new QPushButton(tr("Multiplayer"));// addButton(tr("Multiplayer"), pageLayout, 1, 1);
    72 
    73 
    73 	BtnNet = addButton(":/res/Network play.png", pageLayout, 2, 2, 1, 2, QSize(314, 260));
    74 	BtnNet = addButton(":/res/Network play.png", pageLayout, 1, 2, 1, 2, QSize(314, 289));
    74 	pageLayout->setAlignment(BtnNet, Qt::AlignHCenter);
    75 
    75 
    76 	BtnLoad = new QPushButton(tr("Saved games"));//addButton(tr("Saved games"), pageLayout, 3, 1);
    76 	BtnSetup = addButton(":/res/Settings.png", pageLayout, 3, 3, QSize(54, 50));
    77 
    77 
    78 	BtnDemos = new QPushButton(tr("Demos")); // addButton(tr("Demos"), pageLayout, 4, 1);
    78 	BtnInfo = addButton(":/res/About.png", pageLayout, 3, 1, 1, 2, QSize(116, 37));
    79 
    79 	pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter);
    80 	BtnSetup = addButton(":/res/Settings.png", pageLayout, 2, 3, QSize(54, 50));
    80 
    81 
    81 	BtnExit = addButton(":/res/Exit.png", pageLayout, 3, 0, 1, 1, QSize(58, 52));
    82 	BtnInfo = addButton(":/res/About.png", pageLayout, 2, 1, 1, 2, QSize(116, 37));
       
    83 	pageLayout->setAlignment(BtnInfo, Qt::AlignCenter);
       
    84 
       
    85 	BtnExit = addButton(":/res/Exit.png", pageLayout, 2, 0, 1, 1, QSize(58, 52));
       
    86 }
    82 }
    87 
    83 
    88 PageEditTeam::PageEditTeam(QWidget* parent) :
    84 PageEditTeam::PageEditTeam(QWidget* parent) :
    89   AbstractPage(parent)
    85   AbstractPage(parent)
    90 {
    86 {
   589 	labelGameStats = new QLabel(this);
   585 	labelGameStats = new QLabel(this);
   590 	labelGameStats->setTextFormat(Qt::RichText);
   586 	labelGameStats->setTextFormat(Qt::RichText);
   591 	pageLayout->addWidget(labelGameStats, 0, 0, 1, 3);
   587 	pageLayout->addWidget(labelGameStats, 0, 0, 1, 3);
   592 }
   588 }
   593 
   589 
   594 PageSinglePlayer::PageSinglePlayer(QWidget* parent) : QWidget(parent)
   590 PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent)
   595 {
   591 {
   596 	QFont * font14 = new QFont("MS Shell Dlg", 14);
   592 	QFont * font14 = new QFont("MS Shell Dlg", 14);
   597 	QGridLayout * pageLayout = new QGridLayout(this);
   593 	QGridLayout * pageLayout = new QGridLayout(this);
   598 	pageLayout->setMargin(25);
   594 	pageLayout->setMargin(25);
   599 	pageLayout->setColumnStretch(0, 1);
   595 	pageLayout->setColumnStretch(0, 1);
   600 	pageLayout->setColumnStretch(1, 2);
   596 	pageLayout->setColumnStretch(1, 2);
   601 	pageLayout->setColumnStretch(2, 1);
   597 	pageLayout->setColumnStretch(2, 1);
   602 	pageLayout->setRowStretch(0, 1);
   598 	pageLayout->setRowStretch(0, 1);
   603 	pageLayout->setRowStretch(3, 1);
   599 	pageLayout->setRowStretch(6, 1);
   604 
   600 
   605 	BtnSimpleGamePage = new QPushButton(this);
   601 	BtnSimpleGamePage = addButton(tr("Simple Game"), pageLayout, 1, 1);
   606 	BtnSimpleGamePage->setFont(*font14);
   602 	BtnTrainPage = addButton(tr("Training"), pageLayout, 2, 1);
   607 	BtnSimpleGamePage->setText(QPushButton::tr("Simple Game"));
   603 	BtnMultiplayer = addButton(tr("Multiplayer"), pageLayout, 3, 1);
   608 	pageLayout->addWidget(BtnSimpleGamePage, 1, 1);
   604 	BtnLoad = addButton(tr("Saved games"), pageLayout, 4, 1);
   609 
   605 	BtnDemos = addButton(tr("Demos"), pageLayout, 5, 1);
   610 	BtnTrainPage = new QPushButton(this);
   606 
   611 	BtnTrainPage->setFont(*font14);
   607 	BtnBack = addButton(tr("Back"), pageLayout, 7, 0);
   612 	BtnTrainPage->setText(QPushButton::tr("Training"));
       
   613 	pageLayout->addWidget(BtnTrainPage, 2, 1);
       
   614 
       
   615 	BtnBack = new QPushButton(this);
       
   616 	BtnBack->setFont(*font14);
       
   617 	BtnBack->setText(QPushButton::tr("Back"));
       
   618 	pageLayout->addWidget(BtnBack, 4, 0);
       
   619 
       
   620 }
   608 }
   621 
   609 
   622 PageTraining::PageTraining(QWidget* parent) : QWidget(parent)
   610 PageTraining::PageTraining(QWidget* parent) : QWidget(parent)
   623 {
   611 {
   624 	QFont * font14 = new QFont("MS Shell Dlg", 14);
   612 	QFont * font14 = new QFont("MS Shell Dlg", 14);