Commit 4930a710 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

When tabBarUseUserStyleSheet() is false, don't set a stylesheet at all

Reading the upstream code, it looks like setStyleSheet(QString())[1] will
unset any custom style sheet. This seems like a cleaner solution because
setting a stylesheet at all interferes with changing the widget colorscheme
from a dark to a light scheme or vice versa.

To test:
- open konsole
- open systemsettings and change the colorscheme to a dark one, if you're
  already using a dark one, change to a light one
- widget colors are changed as expected, except for konsole tabs, which look
  odd

Opening a new konsole window seems to clear the issue and the tabs look
normal again.

[1] https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwidget.cpp.html#_ZN7QWidget13setStyleSheetERK7QString
parent e7cc5cd3
......@@ -202,16 +202,10 @@ void TabbedViewContainer::konsoleConfigChanged()
if (KonsoleSettings::tabBarUseUserStyleSheet()) {
setCssFromFile(KonsoleSettings::tabBarUserStyleSheetFile());
} else {
setCss();
setStyleSheet(QString());
}
}
void TabbedViewContainer::setCss(const QString &styleSheet)
{
static const QString defaultCss = QStringLiteral("QTabWidget::tab-bar, QTabWidget::pane { margin: 0; }\n");
setStyleSheet(defaultCss + styleSheet);
}
void TabbedViewContainer::setCssFromFile(const QUrl &url)
{
// Let's only deal w/ local files for now
......@@ -225,7 +219,7 @@ void TabbedViewContainer::setCssFromFile(const QUrl &url)
}
QTextStream in(&file);
setCss(in.readAll());
setStyleSheet(in.readAll());
}
void TabbedViewContainer::moveActiveView(MoveDirection direction)
......
......@@ -87,7 +87,6 @@ public:
/** Changes the active view to the last view */
void activateLastView();
void setCss(const QString &styleSheet = QString());
void setCssFromFile(const QUrl &url);
ViewSplitter *activeViewSplitter();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment