mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 08:09:41 +00:00
Moved the stylesheet to main.cpp and made some stylesheet-related changes
This commit is contained in:
parent
a0586cda99
commit
409bd0fe7e
4 changed files with 48 additions and 52 deletions
|
@ -17,7 +17,6 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
|
|
||||||
mPluginsSelectModel = new QItemSelectionModel(mPluginsModel);
|
mPluginsSelectModel = new QItemSelectionModel(mPluginsModel);
|
||||||
|
|
||||||
//QPushButton *deselectButton = new QPushButton(tr("Deselect All"));
|
|
||||||
QLabel *filterLabel = new QLabel(tr("Filter:"), this);
|
QLabel *filterLabel = new QLabel(tr("Filter:"), this);
|
||||||
LineEdit *filterLineEdit = new LineEdit(this);
|
LineEdit *filterLineEdit = new LineEdit(this);
|
||||||
|
|
||||||
|
@ -31,6 +30,7 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
mMastersWidget = new QTableWidget(this); // Contains the available masters
|
mMastersWidget = new QTableWidget(this); // Contains the available masters
|
||||||
mPluginsTable = new QTableView(this);
|
mPluginsTable = new QTableView(this);
|
||||||
|
|
||||||
|
mMastersWidget->setObjectName("MastersWidget");
|
||||||
mMastersWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
mMastersWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
mMastersWidget->setSelectionMode(QAbstractItemView::MultiSelection);
|
mMastersWidget->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||||
mMastersWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
mMastersWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
|
@ -72,24 +72,22 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
// Bottom part with profile options
|
// Bottom part with profile options
|
||||||
QLabel *profileLabel = new QLabel(tr("Current Profile:"), this);
|
QLabel *profileLabel = new QLabel(tr("Current Profile:"), this);
|
||||||
|
|
||||||
//mProfilesModel = new QStringListModel();
|
|
||||||
|
|
||||||
mProfilesComboBox = new ComboBox(this);
|
mProfilesComboBox = new ComboBox(this);
|
||||||
//mProfilesComboBox->setModel(mProfilesModel);
|
|
||||||
|
|
||||||
mProfilesComboBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
|
mProfilesComboBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||||
mProfilesComboBox->setInsertPolicy(QComboBox::InsertAtBottom);
|
mProfilesComboBox->setInsertPolicy(QComboBox::InsertAtBottom);
|
||||||
//mProfileComboBox->addItem(QString("New Profile"));
|
|
||||||
|
|
||||||
mNewProfileButton = new QPushButton(this);
|
mNewProfileButton = new QPushButton(this);
|
||||||
mNewProfileButton->setIcon(QIcon::fromTheme("document-new"));
|
mNewProfileButton->setIcon(QIcon::fromTheme("document-new"));
|
||||||
|
mNewProfileButton->setToolTip(tr("New Profile"));
|
||||||
mNewProfileButton->setShortcut(QKeySequence(tr("Ctrl+N")));
|
mNewProfileButton->setShortcut(QKeySequence(tr("Ctrl+N")));
|
||||||
|
|
||||||
mCopyProfileButton = new QPushButton(this);
|
mCopyProfileButton = new QPushButton(this);
|
||||||
mCopyProfileButton->setIcon(QIcon::fromTheme("edit-copy"));
|
mCopyProfileButton->setIcon(QIcon::fromTheme("edit-copy"));
|
||||||
|
mCopyProfileButton->setToolTip(tr("Copy Profile"));
|
||||||
|
|
||||||
mDeleteProfileButton = new QPushButton(this);
|
mDeleteProfileButton = new QPushButton(this);
|
||||||
mDeleteProfileButton->setIcon(QIcon::fromTheme("edit-delete"));
|
mDeleteProfileButton->setIcon(QIcon::fromTheme("edit-delete"));
|
||||||
|
mDeleteProfileButton->setToolTip(tr("Delete Profile"));
|
||||||
mDeleteProfileButton->setShortcut(QKeySequence(tr("Delete")));
|
mDeleteProfileButton->setShortcut(QKeySequence(tr("Delete")));
|
||||||
|
|
||||||
QHBoxLayout *bottomLayout = new QHBoxLayout();
|
QHBoxLayout *bottomLayout = new QHBoxLayout();
|
||||||
|
@ -102,11 +100,9 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
|
|
||||||
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
||||||
// Add some space above and below the page items
|
// Add some space above and below the page items
|
||||||
//QSpacerItem *vSpacer1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
|
||||||
QSpacerItem *vSpacer2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
QSpacerItem *vSpacer2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
QSpacerItem *vSpacer3 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
QSpacerItem *vSpacer3 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
|
|
||||||
//pageLayout->addItem(vSpacer1);
|
|
||||||
pageLayout->addLayout(topLayout);
|
pageLayout->addLayout(topLayout);
|
||||||
pageLayout->addItem(vSpacer2);
|
pageLayout->addItem(vSpacer2);
|
||||||
pageLayout->addWidget(splitter);
|
pageLayout->addWidget(splitter);
|
||||||
|
@ -120,9 +116,6 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
connect(mPluginsTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(setCheckstate(QModelIndex)));
|
connect(mPluginsTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(setCheckstate(QModelIndex)));
|
||||||
connect(mPluginsModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(resizeRows()));
|
connect(mPluginsModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(resizeRows()));
|
||||||
|
|
||||||
//connect(mProfileComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(profileChanged(const QString&)));
|
|
||||||
|
|
||||||
|
|
||||||
connect(mNewProfileButton, SIGNAL(pressed()), this, SLOT(newProfile()));
|
connect(mNewProfileButton, SIGNAL(pressed()), this, SLOT(newProfile()));
|
||||||
connect(mCopyProfileButton, SIGNAL(pressed()), this, SLOT(copyProfile()));
|
connect(mCopyProfileButton, SIGNAL(pressed()), this, SLOT(copyProfile()));
|
||||||
connect(mDeleteProfileButton, SIGNAL(pressed()), this, SLOT(deleteProfile()));
|
connect(mDeleteProfileButton, SIGNAL(pressed()), this, SLOT(deleteProfile()));
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
#include "maindialog.hpp"
|
#include "maindialog.hpp"
|
||||||
|
|
||||||
|
@ -9,22 +10,24 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Now we make sure the current dir is set to application path
|
// Now we make sure the current dir is set to application path
|
||||||
QDir dir(QCoreApplication::applicationDirPath());
|
QDir dir(QCoreApplication::applicationDirPath());
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
if (dir.dirName().toLower() == "debug" ||
|
#if defined(Q_OS_MAC)
|
||||||
dir.dirName().toLower() == "release")
|
if (dir.dirName() == "MacOS") {
|
||||||
{
|
|
||||||
dir.cdUp();
|
|
||||||
}
|
|
||||||
#elif defined(Q_OS_MAC)
|
|
||||||
if (dir.dirName() == "MacOS")
|
|
||||||
{
|
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QDir::setCurrent(dir.absolutePath());
|
QDir::setCurrent(dir.absolutePath());
|
||||||
|
|
||||||
|
// Load the stylesheet
|
||||||
|
QFile file("./launcher.qss");
|
||||||
|
|
||||||
|
file.open(QFile::ReadOnly);
|
||||||
|
QString styleSheet = QLatin1String(file.readAll());
|
||||||
|
app.setStyleSheet(styleSheet);
|
||||||
|
|
||||||
MainDialog dialog;
|
MainDialog dialog;
|
||||||
return dialog.exec();
|
return dialog.exec();
|
||||||
|
|
||||||
|
|
|
@ -4,25 +4,21 @@
|
||||||
|
|
||||||
PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
// Load the stylesheet
|
QWidget *playWidget = new QWidget(this);
|
||||||
QFile file("./launcher.qss");
|
playWidget->setObjectName("PlayGroup");
|
||||||
|
playWidget->setFixedSize(QSize(425, 375));
|
||||||
|
|
||||||
file.open(QFile::ReadOnly);
|
mPlayButton = new QPushButton(tr("Play"), playWidget);
|
||||||
QString styleSheet = QLatin1String(file.readAll());
|
mPlayButton->setObjectName("PlayButton");
|
||||||
setStyleSheet(styleSheet);
|
|
||||||
|
|
||||||
QGroupBox *playBox = new QGroupBox(this);
|
|
||||||
playBox->setFixedSize(QSize(425, 375));
|
|
||||||
playBox->setFlat(true);
|
|
||||||
|
|
||||||
mPlayButton = new QPushButton(tr("Play"), playBox);
|
|
||||||
mPlayButton->setMinimumSize(QSize(200, 50));
|
mPlayButton->setMinimumSize(QSize(200, 50));
|
||||||
|
|
||||||
QLabel *profileLabel = new QLabel(tr("Current Profile:"), playBox);
|
QLabel *profileLabel = new QLabel(tr("Current Profile:"), playWidget);
|
||||||
|
profileLabel->setObjectName("ProfileLabel");
|
||||||
|
|
||||||
mProfilesComboBox = new QComboBox(playBox);
|
mProfilesComboBox = new QComboBox(playWidget);
|
||||||
|
mProfilesComboBox->setObjectName("ProfilesComboBox");
|
||||||
|
|
||||||
QGridLayout *playLayout = new QGridLayout(playBox);
|
QGridLayout *playLayout = new QGridLayout(playWidget);
|
||||||
|
|
||||||
QSpacerItem *hSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
QSpacerItem *hSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
QSpacerItem *hSpacer2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
QSpacerItem *hSpacer2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
@ -40,6 +36,6 @@ PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
||||||
|
|
||||||
QHBoxLayout *pageLayout = new QHBoxLayout(this);
|
QHBoxLayout *pageLayout = new QHBoxLayout(this);
|
||||||
|
|
||||||
pageLayout->addWidget(playBox);
|
pageLayout->addWidget(playWidget);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
QGroupBox {
|
#PlayGroup {
|
||||||
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;
|
||||||
|
@ -6,7 +6,11 @@ QGroupBox {
|
||||||
padding-right: 30px;
|
padding-right: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton {
|
#MastersWidget {
|
||||||
|
selection-background-color: palette(highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
#PlayButton {
|
||||||
|
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
|
||||||
|
@ -20,7 +24,7 @@ QPushButton {
|
||||||
stop:0.9 rgba(0, 0, 0, 55),
|
stop:0.9 rgba(0, 0, 0, 55),
|
||||||
stop:1 rgba(0, 0, 0, 100));
|
stop:1 rgba(0, 0, 0, 100));
|
||||||
|
|
||||||
font: 24pt "FreeMono";
|
font: 24pt "Trebuchet MS";
|
||||||
color: black;
|
color: black;
|
||||||
|
|
||||||
border-right: 1px solid rgba(0, 0, 0, 155);
|
border-right: 1px solid rgba(0, 0, 0, 155);
|
||||||
|
@ -31,7 +35,7 @@ QPushButton {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton:hover {
|
#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-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-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-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));
|
||||||
|
@ -40,18 +44,16 @@ QPushButton:hover {
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton:pressed {
|
#PlayButton:pressed {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QLabel
|
#ProfileLabel {
|
||||||
{
|
font: 14pt "Trebuchet MS";
|
||||||
font: 14pt "FreeMono";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QComboBox
|
#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 rgba(255, 255, 255, 200));
|
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:0.2 rgba(0, 0, 0, 25), stop:1 rgba(255, 255, 255, 200));
|
||||||
|
@ -62,17 +64,19 @@ QComboBox
|
||||||
}
|
}
|
||||||
|
|
||||||
/*QComboBox gets the "on" state when the popup is open */
|
/*QComboBox gets the "on" state when the popup is open */
|
||||||
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
|
#ProfilesComboBox:!editable:on, #ProfilesComboBox::drop-down:editable:on {
|
||||||
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 gray, stop:0.2 white);
|
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 gray, stop:0.2 white);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QComboBox { /* shift the text when the popup opens */
|
#ProfilesComboBox { /* shift the text when the popup opens */
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
|
|
||||||
|
font: 11pt "Trebuchet MS";
|
||||||
}
|
}
|
||||||
|
|
||||||
QComboBox::drop-down {
|
#ProfilesComboBox::drop-down {
|
||||||
subcontrol-origin: padding;
|
subcontrol-origin: padding;
|
||||||
subcontrol-position: top right;
|
subcontrol-position: top right;
|
||||||
|
|
||||||
|
@ -84,16 +88,16 @@ QComboBox::drop-down {
|
||||||
border-bottom-right-radius: 3px;
|
border-bottom-right-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QComboBox::down-arrow {
|
#ProfilesComboBox::down-arrow {
|
||||||
image: url(":/images/down.png");
|
image: url(":/images/down.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QComboBox::down-arrow:on { /* shift the arrow when popup is open */
|
#ProfilesComboBox::down-arrow:on { /* shift the arrow when popup is open */
|
||||||
top: 1px;
|
top: 1px;
|
||||||
left: 1px;
|
left: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QListWidget {
|
#IconWidget {
|
||||||
background-image: url(":/images/openmw-header.png");
|
background-image: url(":/images/openmw-header.png");
|
||||||
background-color: white;
|
background-color: white;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
Loading…
Reference in a new issue