1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 12:39:41 +00:00

Remove border from status bar

This commit is contained in:
Andrei Kortunov 2024-05-12 11:53:17 +04:00
parent abd4596cf8
commit e7d566eb2e
2 changed files with 21 additions and 0 deletions

View file

@ -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::ThemeChange || 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)

View file

@ -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);