QTfrontend/ui/page/pagecampaign.cpp
changeset 9219 0a4b6bb69f99
parent 9182 f92e205bc167
child 9306 c9978ada9a3d
equal deleted inserted replaced
9218:673bf356ad8c 9219:0a4b6bb69f99
    17  */
    17  */
    18 
    18 
    19 #include <QGridLayout>
    19 #include <QGridLayout>
    20 #include <QPushButton>
    20 #include <QPushButton>
    21 #include <QComboBox>
    21 #include <QComboBox>
       
    22 #include <QLabel>
    22 
    23 
    23 #include "pagecampaign.h"
    24 #include "pagecampaign.h"
    24 
    25 
    25 QLayout * PageCampaign::bodyLayoutDefinition()
    26 QLayout * PageCampaign::bodyLayoutDefinition()
    26 {
    27 {
    29     pageLayout->setColumnStretch(1, 2);
    30     pageLayout->setColumnStretch(1, 2);
    30     pageLayout->setColumnStretch(2, 1);
    31     pageLayout->setColumnStretch(2, 1);
    31     pageLayout->setRowStretch(0, 1);
    32     pageLayout->setRowStretch(0, 1);
    32     pageLayout->setRowStretch(3, 1);
    33     pageLayout->setRowStretch(3, 1);
    33 
    34 
       
    35     QGridLayout * infoLayout = new QGridLayout();
       
    36     infoLayout->setColumnStretch(0, 1);
       
    37     infoLayout->setColumnStretch(1, 1);
       
    38     infoLayout->setColumnStretch(2, 1);
       
    39     infoLayout->setColumnStretch(3, 1);
       
    40     infoLayout->setColumnStretch(4, 1);
       
    41     infoLayout->setRowStretch(0, 1);
       
    42     infoLayout->setRowStretch(1, 1);
       
    43 
       
    44     // set this as default image first time page is created, this will change in hwform.cpp
       
    45     btnPreview = formattedButton(":/res/campaign/A Classic Fairytale/first_blood.png", true);
       
    46     infoLayout->setAlignment(btnPreview, Qt::AlignHCenter | Qt::AlignVCenter);
       
    47 
       
    48     lbldescription = new QLabel();
       
    49     lbldescription->setAlignment(Qt::AlignHCenter| Qt::AlignTop);
       
    50     lbldescription->setWordWrap(true);
       
    51 
       
    52     lbltitle = new QLabel();
       
    53     lbltitle->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
       
    54 
    34     CBTeam = new QComboBox(this);
    55     CBTeam = new QComboBox(this);
    35     CBMission = new QComboBox(this);
    56     CBMission = new QComboBox(this);
    36     CBCampaign = new QComboBox(this);
    57     CBCampaign = new QComboBox(this);
    37 
    58 
    38     pageLayout->addWidget(CBTeam, 1, 1);
    59     infoLayout->addWidget(btnPreview,0,1,2,1);
    39     pageLayout->addWidget(CBCampaign, 2, 1);
    60     infoLayout->addWidget(lbltitle,0,2,1,2);
    40     pageLayout->addWidget(CBMission, 3, 1);
    61     infoLayout->addWidget(lbldescription,1,2,1,2);
       
    62 
       
    63     pageLayout->addLayout(infoLayout, 0, 0, 2, 3);
       
    64     pageLayout->addWidget(CBTeam, 2, 1);
       
    65     pageLayout->addWidget(CBCampaign, 3, 1);
       
    66     pageLayout->addWidget(CBMission, 4, 1);
    41 
    67 
    42     BtnStartCampaign = new QPushButton(this);
    68     BtnStartCampaign = new QPushButton(this);
    43     BtnStartCampaign->setFont(*font14);
    69     BtnStartCampaign->setFont(*font14);
    44     BtnStartCampaign->setText(QPushButton::tr("Go!"));
    70     BtnStartCampaign->setText(QPushButton::tr("Go!"));
    45     pageLayout->addWidget(BtnStartCampaign, 2, 2);
    71     pageLayout->addWidget(BtnStartCampaign, 3, 2);
    46 
    72 
    47     return pageLayout;
    73     return pageLayout;
    48 }
    74 }
    49 
    75 
    50 PageCampaign::PageCampaign(QWidget* parent) : AbstractPage(parent)
    76 PageCampaign::PageCampaign(QWidget* parent) : AbstractPage(parent)