Modified Play page, widgets are now properly centered

actorid
Pieter van der Kloet 14 years ago
parent 8256343d77
commit 366ade0e5f

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

@ -2,16 +2,12 @@ QGroupBox {
background-image: url(":/images/playpage-background.png");
background-repeat: no-repeat;
background-position: top;
padding-top: 100px;
padding-left: 30px;
padding-right: 30px;
padding-bottom: 100px;
}
QPushButton {
width: 200px;
max-width: 200px;
height: 50px;
margin-bottom: 30px;
@ -50,17 +46,12 @@ QPushButton:pressed {
QLabel
{
margin-left: 90%;
font: 14pt "Gauntlet Classic";
}
QComboBox
{
width: 180px;
max-width: 200px;
height: 20px;
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));

Loading…
Cancel
Save