mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 02:36:40 +00:00
Merge branch 'style_change' into 'master'
Minor changes in Qt styles handling See merge request OpenMW/openmw!4093
This commit is contained in:
commit
2bed7450b6
9 changed files with 50 additions and 17 deletions
|
@ -22,6 +22,11 @@
|
||||||
#include "importpage.hpp"
|
#include "importpage.hpp"
|
||||||
#include "settingspage.hpp"
|
#include "settingspage.hpp"
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
constexpr const char* toolBarStyle = "QToolBar { border: 0px; } QToolButton { min-width: 70px }";
|
||||||
|
}
|
||||||
|
|
||||||
using namespace Process;
|
using namespace Process;
|
||||||
|
|
||||||
void cfgError(const QString& title, const QString& msg)
|
void cfgError(const QString& title, const QString& msg)
|
||||||
|
@ -73,6 +78,7 @@ Launcher::MainDialog::MainDialog(const Files::ConfigurationManager& configuratio
|
||||||
QLabel* logo = new QLabel(this);
|
QLabel* logo = new QLabel(this);
|
||||||
logo->setPixmap(QIcon(":/images/openmw-header.png").pixmap(QSize(294, 64)));
|
logo->setPixmap(QIcon(":/images/openmw-header.png").pixmap(QSize(294, 64)));
|
||||||
toolBar->addWidget(logo);
|
toolBar->addWidget(logo);
|
||||||
|
toolBar->setStyleSheet(toolBarStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
Launcher::MainDialog::~MainDialog()
|
Launcher::MainDialog::~MainDialog()
|
||||||
|
@ -81,6 +87,18 @@ Launcher::MainDialog::~MainDialog()
|
||||||
delete mWizardInvoker;
|
delete mWizardInvoker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Launcher::MainDialog::event(QEvent* event)
|
||||||
|
{
|
||||||
|
// Apply style sheet again if style was changed
|
||||||
|
if (event->type() == QEvent::PaletteChange)
|
||||||
|
{
|
||||||
|
if (toolBar != nullptr)
|
||||||
|
toolBar->setStyleSheet(toolBarStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
return QMainWindow::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
void Launcher::MainDialog::createIcons()
|
void Launcher::MainDialog::createIcons()
|
||||||
{
|
{
|
||||||
if (!QIcon::hasThemeIcon("document-new"))
|
if (!QIcon::hasThemeIcon("document-new"))
|
||||||
|
|
|
@ -60,6 +60,9 @@ namespace Launcher
|
||||||
void play();
|
void play();
|
||||||
void help();
|
void help();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool event(QEvent* event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void wizardStarted();
|
void wizardStarted();
|
||||||
void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
|
|
|
@ -75,16 +75,6 @@
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">QToolBar {
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton {
|
|
||||||
min-width: 70px;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="movable">
|
<property name="movable">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -11,7 +11,7 @@ void LineEdit::setupClearButton()
|
||||||
mClearButton = new QToolButton(this);
|
mClearButton = new QToolButton(this);
|
||||||
mClearButton->setIcon(QIcon::fromTheme("edit-clear"));
|
mClearButton->setIcon(QIcon::fromTheme("edit-clear"));
|
||||||
mClearButton->setCursor(Qt::ArrowCursor);
|
mClearButton->setCursor(Qt::ArrowCursor);
|
||||||
mClearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
|
mClearButton->setAutoRaise(true);
|
||||||
mClearButton->hide();
|
mClearButton->hide();
|
||||||
connect(mClearButton, &QToolButton::clicked, this, &LineEdit::clear);
|
connect(mClearButton, &QToolButton::clicked, this, &LineEdit::clear);
|
||||||
connect(this, &LineEdit::textChanged, this, &LineEdit::updateClearButton);
|
connect(this, &LineEdit::textChanged, this, &LineEdit::updateClearButton);
|
||||||
|
|
|
@ -177,6 +177,8 @@ void CSVDoc::FileDialog::slotUpdateAcceptButton(const QString& name, bool)
|
||||||
mAdjusterWidget->setName("", true);
|
mAdjusterWidget->setName("", true);
|
||||||
|
|
||||||
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setEnabled(success);
|
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setEnabled(success);
|
||||||
|
if (success)
|
||||||
|
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CSVDoc::FileDialog::filename() const
|
QString CSVDoc::FileDialog::filename() const
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
#include "creator.hpp"
|
#include "creator.hpp"
|
||||||
#include "infocreator.hpp"
|
#include "infocreator.hpp"
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
constexpr const char* statusBarStyle = "QStatusBar::item { border: 0px }";
|
||||||
|
}
|
||||||
|
|
||||||
void CSVWorld::TableBottomBox::updateSize()
|
void CSVWorld::TableBottomBox::updateSize()
|
||||||
{
|
{
|
||||||
// Make sure that the size of the bottom box is determined by the currently visible widget
|
// Make sure that the size of the bottom box is determined by the currently visible widget
|
||||||
|
@ -104,6 +109,7 @@ CSVWorld::TableBottomBox::TableBottomBox(const CreatorFactoryBase& creatorFactor
|
||||||
mStatusBar = new QStatusBar(this);
|
mStatusBar = new QStatusBar(this);
|
||||||
|
|
||||||
mStatusBar->addWidget(mStatus);
|
mStatusBar->addWidget(mStatus);
|
||||||
|
mStatusBar->setStyleSheet(statusBarStyle);
|
||||||
|
|
||||||
mLayout->addWidget(mStatusBar);
|
mLayout->addWidget(mStatusBar);
|
||||||
|
|
||||||
|
@ -129,6 +135,18 @@ CSVWorld::TableBottomBox::TableBottomBox(const CreatorFactoryBase& creatorFactor
|
||||||
updateSize();
|
updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSVWorld::TableBottomBox::event(QEvent* event)
|
||||||
|
{
|
||||||
|
// Apply style sheet again if style was changed
|
||||||
|
if (event->type() == QEvent::PaletteChange)
|
||||||
|
{
|
||||||
|
if (mStatusBar != nullptr)
|
||||||
|
mStatusBar->setStyleSheet(statusBarStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
return QWidget::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
void CSVWorld::TableBottomBox::setEditLock(bool locked)
|
void CSVWorld::TableBottomBox::setEditLock(bool locked)
|
||||||
{
|
{
|
||||||
if (mCreator)
|
if (mCreator)
|
||||||
|
|
|
@ -61,6 +61,9 @@ namespace CSVWorld
|
||||||
|
|
||||||
void extendedConfigRequest(ExtendedCommandConfigurator::Mode mode, const std::vector<std::string>& selectedIds);
|
void extendedConfigRequest(ExtendedCommandConfigurator::Mode mode, const std::vector<std::string>& selectedIds);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool event(QEvent* event) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TableBottomBox(const CreatorFactoryBase& creatorFactory, CSMDoc::Document& document,
|
TableBottomBox(const CreatorFactoryBase& creatorFactory, CSMDoc::Document& document,
|
||||||
const CSMWorld::UniversalId& id, QWidget* parent = nullptr);
|
const CSMWorld::UniversalId& id, QWidget* parent = nullptr);
|
||||||
|
|
|
@ -23,6 +23,11 @@ Wizard::MethodSelectionPage::MethodSelectionPage(QWidget* parent)
|
||||||
buyLinkButton->released();
|
buyLinkButton->released();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QFont font = existingLocationRadioButton->font();
|
||||||
|
font.setBold(true);
|
||||||
|
existingLocationRadioButton->setFont(font);
|
||||||
|
retailDiscRadioButton->setFont(font);
|
||||||
|
|
||||||
registerField(QLatin1String("installation.retailDisc"), retailDiscRadioButton);
|
registerField(QLatin1String("installation.retailDisc"), retailDiscRadioButton);
|
||||||
|
|
||||||
connect(buyLinkButton, &QPushButton::released, this, &MethodSelectionPage::handleBuyButton);
|
connect(buyLinkButton, &QPushButton::released, this, &MethodSelectionPage::handleBuyButton);
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="retailDiscRadioButton">
|
<widget class="QRadioButton" name="retailDiscRadioButton">
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">font-weight:bold;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Retail CD/DVD</string>
|
<string>Retail CD/DVD</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -81,9 +78,6 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="existingLocationRadioButton">
|
<widget class="QRadioButton" name="existingLocationRadioButton">
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">font-weight:bold</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Existing Installation</string>
|
<string>Existing Installation</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in a new issue