mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Made the Play page use a .ui file too
This commit is contained in:
parent
f2193bb1ba
commit
0a6e3701ab
6 changed files with 170 additions and 166 deletions
|
@ -94,8 +94,8 @@ void MainDialog::createPages()
|
||||||
mDataFilesPage = new DataFilesPage(mCfgMgr, mGameSettings, mLauncherSettings, this);
|
mDataFilesPage = new DataFilesPage(mCfgMgr, mGameSettings, mLauncherSettings, this);
|
||||||
|
|
||||||
// Set the combobox of the play page to imitate the combobox on the datafilespage
|
// Set the combobox of the play page to imitate the combobox on the datafilespage
|
||||||
mPlayPage->mProfilesComboBox->setModel(mDataFilesPage->mProfilesComboBox->model());
|
mPlayPage->setProfilesComboBoxModel(mDataFilesPage->mProfilesComboBox->model());
|
||||||
mPlayPage->mProfilesComboBox->setCurrentIndex(mDataFilesPage->mProfilesComboBox->currentIndex());
|
mPlayPage->setProfilesComboBoxIndex(mDataFilesPage->mProfilesComboBox->currentIndex());
|
||||||
|
|
||||||
// Add the pages to the stacked widget
|
// Add the pages to the stacked widget
|
||||||
pagesWidget->addWidget(mPlayPage);
|
pagesWidget->addWidget(mPlayPage);
|
||||||
|
@ -105,15 +105,10 @@ void MainDialog::createPages()
|
||||||
// Select the first page
|
// Select the first page
|
||||||
iconWidget->setCurrentItem(iconWidget->item(0), QItemSelectionModel::Select);
|
iconWidget->setCurrentItem(iconWidget->item(0), QItemSelectionModel::Select);
|
||||||
|
|
||||||
connect(mPlayPage->mPlayButton, SIGNAL(clicked()), this, SLOT(play()));
|
connect(mPlayPage, SIGNAL(playButtonClicked()), this, SLOT(play()));
|
||||||
|
|
||||||
connect(mPlayPage->mProfilesComboBox,
|
connect(mPlayPage, SIGNAL(profileChanged(int)), mDataFilesPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
|
||||||
SIGNAL(currentIndexChanged(int)),
|
connect(mDataFilesPage->mProfilesComboBox, SIGNAL(currentIndexChanged(int)), mPlayPage, SLOT(setProfilesComboBoxIndex(int)));
|
||||||
mDataFilesPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
|
|
||||||
|
|
||||||
connect(mDataFilesPage->mProfilesComboBox,
|
|
||||||
SIGNAL(currentIndexChanged(int)),
|
|
||||||
mPlayPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,6 @@ class MainDialog : public QMainWindow, private Ui::MainWindow
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MainDialog();
|
MainDialog();
|
||||||
|
|
||||||
|
|
||||||
// GameSettings &gameSettings,
|
|
||||||
// GraphicsSettings &GraphicsSettings,
|
|
||||||
// LauncherSettings &launcherSettings);
|
|
||||||
|
|
||||||
bool setup();
|
bool setup();
|
||||||
bool showFirstRunDialog();
|
bool showFirstRunDialog();
|
||||||
|
|
||||||
|
@ -58,9 +52,6 @@ private:
|
||||||
|
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
// QListWidget *mIconWidget;
|
|
||||||
// QStackedWidget *mPagesWidget;
|
|
||||||
|
|
||||||
PlayPage *mPlayPage;
|
PlayPage *mPlayPage;
|
||||||
GraphicsPage *mGraphicsPage;
|
GraphicsPage *mGraphicsPage;
|
||||||
DataFilesPage *mDataFilesPage;
|
DataFilesPage *mDataFilesPage;
|
||||||
|
|
|
@ -4,45 +4,37 @@
|
||||||
|
|
||||||
PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
QWidget *playWidget = new QWidget(this);
|
setupUi(this);
|
||||||
playWidget->setObjectName("PlayGroup");
|
|
||||||
playWidget->setFixedSize(QSize(425, 375));
|
|
||||||
|
|
||||||
mPlayButton = new QPushButton(tr("Play"), playWidget);
|
|
||||||
mPlayButton->setObjectName("PlayButton");
|
|
||||||
mPlayButton->setMinimumSize(QSize(200, 50));
|
|
||||||
|
|
||||||
QLabel *profileLabel = new QLabel(tr("Current Profile:"), playWidget);
|
|
||||||
profileLabel->setObjectName("ProfileLabel");
|
|
||||||
|
|
||||||
// Hacks to get the stylesheet look properly on different platforms
|
// Hacks to get the stylesheet look properly on different platforms
|
||||||
QPlastiqueStyle *style = new QPlastiqueStyle;
|
QPlastiqueStyle *style = new QPlastiqueStyle;
|
||||||
QFont font = QApplication::font();
|
QFont font = QApplication::font();
|
||||||
font.setPointSize(12); // Fixes problem with overlapping items
|
font.setPointSize(12); // Fixes problem with overlapping items
|
||||||
|
|
||||||
mProfilesComboBox = new QComboBox(playWidget);
|
profilesComboBox->setStyle(style);
|
||||||
mProfilesComboBox->setObjectName("ProfilesComboBox");
|
profilesComboBox->setFont(font);
|
||||||
mProfilesComboBox->setStyle(style);
|
|
||||||
mProfilesComboBox->setFont(font);
|
|
||||||
|
|
||||||
QGridLayout *playLayout = new QGridLayout(playWidget);
|
connect(profilesComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentIndexChanged(int)));
|
||||||
|
connect(playButton, SIGNAL(clicked()), this, SLOT(slotPlayClicked()));
|
||||||
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->addWidget(mPlayButton, 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);
|
|
||||||
|
|
||||||
pageLayout->addWidget(playWidget);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayPage::setProfilesComboBoxModel(QAbstractItemModel *model)
|
||||||
|
{
|
||||||
|
profilesComboBox->setModel(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayPage::setProfilesComboBoxIndex(int index)
|
||||||
|
{
|
||||||
|
profilesComboBox->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayPage::slotCurrentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
emit profileChanged(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayPage::slotPlayClicked()
|
||||||
|
{
|
||||||
|
emit playButtonClicked();
|
||||||
|
}
|
||||||
|
|
|
@ -3,19 +3,33 @@
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "ui_playpage.h"
|
||||||
|
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
class QAbstractItemModel;
|
||||||
|
|
||||||
class PlayPage : public QWidget
|
class PlayPage : public QWidget, private Ui::PlayPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlayPage(QWidget *parent = 0);
|
PlayPage(QWidget *parent = 0);
|
||||||
|
void setProfilesComboBoxModel(QAbstractItemModel *model);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void profileChanged(int index);
|
||||||
|
void playButtonClicked();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setProfilesComboBoxIndex(int index);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slotCurrentIndexChanged(int index);
|
||||||
|
void slotPlayClicked();
|
||||||
|
|
||||||
|
|
||||||
QComboBox *mProfilesComboBox;
|
|
||||||
QPushButton *mPlayButton;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>graphicsPage</class>
|
<class>GraphicsPage</class>
|
||||||
<widget class="QWidget" name="graphicsPage">
|
<widget class="QWidget" name="GraphicsPage">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
|
|
@ -1,107 +1,38 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>playPage</class>
|
<class>PlayPage</class>
|
||||||
<widget class="QWidget" name="playPage">
|
<widget class="QWidget" name="PlayPage">
|
||||||
<property name="styleSheet">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<string notr="true">#playPage {
|
<item>
|
||||||
|
<widget class="QFrame" name="Scroll">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#Scroll {
|
||||||
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;
|
||||||
}
|
}
|
||||||
</string>
|
</string>
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>30</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>30</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QPushButton" name="playButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>85</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="frameShape">
|
||||||
<size>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<width>200</width>
|
|
||||||
<height>85</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="frameShadow">
|
||||||
<string notr="true">#playButton {
|
<enum>QFrame::Plain</enum>
|
||||||
height: 50px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
|
|
||||||
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
|
|
||||||
stop:0 rgba(255, 255, 255, 200),
|
|
||||||
stop:0.1 rgba(255, 255, 255, 15),
|
|
||||||
stop:0.49 rgba(255, 255, 255, 75),
|
|
||||||
stop:0.5 rgba(0, 0, 0, 0),
|
|
||||||
stop:0.9 rgba(0, 0, 0, 55),
|
|
||||||
stop:1 rgba(0, 0, 0, 100));
|
|
||||||
|
|
||||||
font-size: 26pt;
|
|
||||||
font-family: "EB Garamond", "EB Garamond 08";
|
|
||||||
color: black;
|
|
||||||
|
|
||||||
border-right: 1px solid rgba(0, 0, 0, 155);
|
|
||||||
border-left: 1px solid rgba(0, 0, 0, 55);
|
|
||||||
border-top: 1px solid rgba(0, 0, 0, 55);
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 155);
|
|
||||||
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#playButton:hover {
|
|
||||||
border-bottom: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
|
||||||
border-top: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
|
||||||
border-right: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
|
||||||
border-left: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
|
||||||
border-width: 2px;
|
|
||||||
border-style: solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
#playButton:pressed {
|
|
||||||
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
|
||||||
stop:0 rgba(0, 0, 0, 75),
|
|
||||||
stop:0.1 rgba(0, 0, 0, 15),
|
|
||||||
stop:0.2 rgba(255, 255, 255, 55)
|
|
||||||
stop:0.95 rgba(255, 255, 255, 55),
|
|
||||||
stop:1 rgba(255, 255, 255, 155));
|
|
||||||
|
|
||||||
border: 1px solid rgba(0, 0, 0, 55);
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<string>Play</string>
|
<property name="leftMargin">
|
||||||
</property>
|
<number>30</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="topMargin">
|
||||||
<item row="1" column="0">
|
<number>100</number>
|
||||||
<widget class="QLabel" name="profileLabel">
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="rightMargin">
|
||||||
<string notr="true">#profileLabel {
|
<number>30</number>
|
||||||
font-size: 18pt;
|
</property>
|
||||||
font-family: "EB Garamond", "EB Garamond 08";
|
<item row="4" column="1">
|
||||||
}
|
<widget class="QComboBox" name="profilesComboBox">
|
||||||
</string>
|
<property name="styleSheet">
|
||||||
</property>
|
<string notr="true">#profilesComboBox {
|
||||||
<property name="text">
|
|
||||||
<string>Current Profile:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QComboBox" name="profilesComboBox">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">#profilesComboBox {
|
|
||||||
padding: 1px 18px 1px 3px;
|
padding: 1px 18px 1px 3px;
|
||||||
|
|
||||||
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:0.2 rgba(0, 0, 0, 25), stop:1 white);
|
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:0.2 rgba(0, 0, 0, 25), stop:1 white);
|
||||||
|
@ -155,22 +86,103 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLabel" name="profileLabel">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#profileLabel {
|
||||||
|
font-size: 18pt;
|
||||||
|
font-family: "EB Garamond", "EB Garamond 08";
|
||||||
|
}
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Current Profile:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="playButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>85</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>85</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#playButton {
|
||||||
|
height: 50px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
|
||||||
|
stop:0 rgba(255, 255, 255, 200),
|
||||||
|
stop:0.1 rgba(255, 255, 255, 15),
|
||||||
|
stop:0.49 rgba(255, 255, 255, 75),
|
||||||
|
stop:0.5 rgba(0, 0, 0, 0),
|
||||||
|
stop:0.9 rgba(0, 0, 0, 55),
|
||||||
|
stop:1 rgba(0, 0, 0, 100));
|
||||||
|
|
||||||
|
font-size: 26pt;
|
||||||
|
font-family: "EB Garamond", "EB Garamond 08";
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
border-right: 1px solid rgba(0, 0, 0, 155);
|
||||||
|
border-left: 1px solid rgba(0, 0, 0, 55);
|
||||||
|
border-top: 1px solid rgba(0, 0, 0, 55);
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 155);
|
||||||
|
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#playButton:hover {
|
||||||
|
border-bottom: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
||||||
|
border-top: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
||||||
|
border-right: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
||||||
|
border-left: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(164, 192, 228, 255), stop:1 rgba(255, 255, 255, 0));
|
||||||
|
border-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#playButton:pressed {
|
||||||
|
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||||
|
stop:0 rgba(0, 0, 0, 75),
|
||||||
|
stop:0.1 rgba(0, 0, 0, 15),
|
||||||
|
stop:0.2 rgba(255, 255, 255, 55)
|
||||||
|
stop:0.95 rgba(255, 255, 255, 55),
|
||||||
|
stop:1 rgba(255, 255, 255, 155));
|
||||||
|
|
||||||
|
border: 1px solid rgba(0, 0, 0, 55);
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Play</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
Loading…
Reference in a new issue