From 77ac8760d1e5d81dea01d3872f69ff10c60fd662 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Tue, 26 Jun 2012 03:07:54 +0200 Subject: [PATCH] Cleaned up the GUI of the Graphics page --- apps/launcher/graphicspage.cpp | 57 ++++++++++++---------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index e3c678f7f..e517454c7 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -32,57 +32,38 @@ GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, QWidget *parent) renderSystemLayout->addWidget(rendererLabel, 0, 0, 1, 1); renderSystemLayout->addWidget(mRendererComboBox, 0, 1, 1, 1); - QVBoxLayout *rendererGroupLayout = new QVBoxLayout(rendererGroup); - - rendererGroupLayout->addLayout(renderSystemLayout); - // Display QGroupBox *displayGroup = new QGroupBox(tr("Display"), this); - mDisplayStackedWidget = new QStackedWidget(displayGroup); + mVSyncCheckBox = new QCheckBox(tr("Vertical Sync"), displayGroup); + mFullScreenCheckBox = new QCheckBox(tr("Full Screen"), displayGroup); + + QLabel *antiAliasingLabel = new QLabel(tr("Antialiasing:"), displayGroup); + QLabel *resolutionLabel = new QLabel(tr("Resolution:"), displayGroup); - QVBoxLayout *displayGroupLayout = new QVBoxLayout(displayGroup); - QSpacerItem *vSpacer3 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); + mResolutionComboBox = new QComboBox(displayGroup); + mAntiAliasingComboBox = new QComboBox(displayGroup); - displayGroupLayout->addWidget(mDisplayStackedWidget); - displayGroupLayout->addItem(vSpacer3); + QVBoxLayout *rendererGroupLayout = new QVBoxLayout(rendererGroup); + rendererGroupLayout->addLayout(renderSystemLayout); + + QGridLayout *displayGroupLayout = new QGridLayout(displayGroup); + displayGroupLayout->addWidget(mVSyncCheckBox, 0, 0, 1, 1); + displayGroupLayout->addWidget(mFullScreenCheckBox, 1, 0, 1, 1); + displayGroupLayout->addWidget(antiAliasingLabel, 2, 0, 1, 1); + displayGroupLayout->addWidget(mAntiAliasingComboBox, 2, 1, 1, 1); + displayGroupLayout->addWidget(resolutionLabel, 3, 0, 1, 1); + displayGroupLayout->addWidget(mResolutionComboBox, 3, 1, 1, 1); // Layout for the whole page QVBoxLayout *pageLayout = new QVBoxLayout(this); + QSpacerItem *vSpacer1 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); pageLayout->addWidget(rendererGroup); pageLayout->addWidget(displayGroup); + pageLayout->addItem(vSpacer1); connect(mRendererComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(rendererChanged(const QString&))); - - createPages(); -} - -void GraphicsPage::createPages() -{ - QWidget *main = new QWidget(); - QGridLayout *grid = new QGridLayout(main); - - mVSyncCheckBox = new QCheckBox(tr("Vertical Sync"), main); - grid->addWidget(mVSyncCheckBox, 0, 0, 1, 1); - - mFullScreenCheckBox = new QCheckBox(tr("Full Screen"), main); - grid->addWidget(mFullScreenCheckBox, 1, 0, 1, 1); - - QLabel *antiAliasingLabel = new QLabel(tr("Antialiasing:"), main); - mAntiAliasingComboBox = new QComboBox(main); - grid->addWidget(antiAliasingLabel, 2, 0, 1, 1); - grid->addWidget(mAntiAliasingComboBox, 2, 1, 1, 1); - - QLabel *resolutionLabel = new QLabel(tr("Resolution:"), main); - mResolutionComboBox = new QComboBox(main); - grid->addWidget(resolutionLabel, 3, 0, 1, 1); - grid->addWidget(mResolutionComboBox, 3, 1, 1, 1); - - QSpacerItem *vSpacer1 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); - grid->addItem(vSpacer1, 4, 0, 1, 1); - - mDisplayStackedWidget->addWidget(main); } bool GraphicsPage::setupOgre()