1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-05 06:40:09 +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 "infocreator.hpp"
namespace
{
constexpr const char* statusBarStyle = "QStatusBar::item { border: 0px }";
}
void CSVWorld::TableBottomBox::updateSize()
{
// 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->addWidget(mStatus);
mStatusBar->setStyleSheet(statusBarStyle);
mLayout->addWidget(mStatusBar);
@ -129,6 +135,18 @@ CSVWorld::TableBottomBox::TableBottomBox(const CreatorFactoryBase& creatorFactor
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)
{
if (mCreator)

View File

@ -61,6 +61,9 @@ namespace CSVWorld
void extendedConfigRequest(ExtendedCommandConfigurator::Mode mode, const std::vector<std::string>& selectedIds);
protected:
bool event(QEvent* event) override;
public:
TableBottomBox(const CreatorFactoryBase& creatorFactory, CSMDoc::Document& document,
const CSMWorld::UniversalId& id, QWidget* parent = nullptr);