1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:53:51 +00:00

Modified Play page, widgets are now properly centered

This commit is contained in:
Pieter van der Kloet 2011-05-02 17:46:02 +02:00
parent 8256343d77
commit 366ade0e5f
2 changed files with 14 additions and 30 deletions

View file

@ -4,51 +4,44 @@
PlayPage::PlayPage(QWidget *parent) : QWidget(parent) PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
{ {
// TODO: Should be an install path // Load the stylesheet
QFile file("apps/launcher/resources/launcher.qss"); QFile file("resources/launcher.qss");
file.open(QFile::ReadOnly); file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll()); QString styleSheet = QLatin1String(file.readAll());
setStyleSheet(styleSheet); setStyleSheet(styleSheet);
QGroupBox *playBox = new QGroupBox(this); QGroupBox *playBox = new QGroupBox(this);
playBox->setObjectName("PlayBox");
playBox->setFixedSize(QSize(425, 375)); playBox->setFixedSize(QSize(425, 375));
playBox->setFlat(true); playBox->setFlat(true);
QVBoxLayout *playLayout = new QVBoxLayout(playBox);
QPushButton *playButton = new QPushButton(tr("Play"), playBox); QPushButton *playButton = new QPushButton(tr("Play"), playBox);
playButton->setObjectName("PlayButton"); playButton->setMinimumSize(QSize(200, 50));
//playButton->setMinimumSize(QSize(150, 50));
QLabel *profileLabel = new QLabel(tr("Current Profile:"), playBox); QLabel *profileLabel = new QLabel(tr("Current Profile:"), playBox);
profileLabel->setObjectName("ProfileLabel");
// TODO: Cleanup
mProfilesModel = new QStringListModel(); mProfilesModel = new QStringListModel();
mProfilesComboBox = new QComboBox(playBox); mProfilesComboBox = new QComboBox(playBox);
mProfilesComboBox->setObjectName("ProfileComboBox");
//mProfileComboBox->setMinimumWidth(200);
mProfilesComboBox->setModel(mProfilesModel); mProfilesComboBox->setModel(mProfilesModel);
QGridLayout *playLayout = new QGridLayout(playBox);
QSpacerItem *hSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
QSpacerItem *hSpacer2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
QSpacerItem *vSpacer1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); QSpacerItem *vSpacer1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
QSpacerItem *vSpacer2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); QSpacerItem *vSpacer2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
playLayout->addItem(vSpacer1); playLayout->addWidget(playButton, 1, 1, 1, 1);
playLayout->addWidget(playButton); playLayout->addWidget(profileLabel, 2, 1, 1, 1);
playLayout->addWidget(profileLabel); playLayout->addWidget(mProfilesComboBox, 3, 1, 1, 1);
playLayout->addWidget(mProfilesComboBox); playLayout->addItem(hSpacer1, 2, 0, 1, 1);
playLayout->addItem(vSpacer2); playLayout->addItem(hSpacer2, 2, 2, 1, 1);
playLayout->addItem(vSpacer1, 0, 1, 1, 1);
playLayout->addItem(vSpacer2, 4, 1, 1, 1);
QHBoxLayout *pageLayout = new QHBoxLayout(this); QHBoxLayout *pageLayout = new QHBoxLayout(this);
QSpacerItem *hSpacer1 = new QSpacerItem(54, 90, QSizePolicy::Expanding, QSizePolicy::Minimum);
QSpacerItem *hSpacer2 = new QSpacerItem(54, 90, QSizePolicy::Expanding, QSizePolicy::Minimum);
pageLayout->addItem(hSpacer1);
pageLayout->addWidget(playBox); pageLayout->addWidget(playBox);
pageLayout->addItem(hSpacer2);
} }

View file

@ -2,16 +2,12 @@ QGroupBox {
background-image: url(":/images/playpage-background.png"); background-image: url(":/images/playpage-background.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top; background-position: top;
padding-top: 100px;
padding-left: 30px; padding-left: 30px;
padding-right: 30px; padding-right: 30px;
padding-bottom: 100px;
} }
QPushButton { QPushButton {
width: 200px;
max-width: 200px;
height: 50px; height: 50px;
margin-bottom: 30px; margin-bottom: 30px;
@ -50,17 +46,12 @@ QPushButton:pressed {
QLabel QLabel
{ {
margin-left: 90%;
font: 14pt "Gauntlet Classic"; font: 14pt "Gauntlet Classic";
} }
QComboBox QComboBox
{ {
width: 180px;
max-width: 200px;
height: 20px;
padding: 1px 18px 1px 3px; padding: 1px 18px 1px 3px;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 gray, stop:0.2 white, stop:1 rgba(255, 255, 255, 55)); background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 gray, stop:0.2 white, stop:1 rgba(255, 255, 255, 55));