generic: remove gtk style references

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-12-30 11:54:16 +02:00
parent 08ebc678c0
commit fe37099810
2 changed files with 0 additions and 26 deletions

View file

@ -120,12 +120,6 @@ static void initViewPalette(QAbstractItemView* view, const QColor& fgColor)
view->setPalette(palette);
}
static bool styleIsGtkBased()
{
const char* name = QApplication::style()->metaObject()->className();
return qstrcmp(name, "QGtkStyle") == 0;
}
StartMainPage::StartMainPage(QWidget* parent, GvCore* gvCore)
: QFrame(parent)
, d(new StartMainPagePrivate)
@ -135,14 +129,6 @@ StartMainPage::StartMainPage(QWidget* parent, GvCore* gvCore)
d->mSearchUiInitialized = false;
d->setupUi(this);
if (styleIsGtkBased()) {
// Gtk-based styles do not apply the correct background color on tabs.
// As a workaround, use the Plastique style instead.
QStyle* fix = new QPlastiqueStyle();
fix->setParent(this);
d->mHistoryWidget->tabBar()->setStyle(fix);
d->mPlacesTagsWidget->tabBar()->setStyle(fix);
}
setFrameStyle(QFrame::NoFrame);
// Bookmark view

View file

@ -45,18 +45,6 @@ PartWidget::PartWidget(QWidget* parent, const Partition* p) :
m_Active(false)
{
setFont(KGlobalSettings::smallestReadableFont());
// Check if user is running a GTK style; in that case, use plastique as a fallback
// style for the PartWidget to work around GTK styles not showing the FS colors
// correctly.
// Inspired by Aurélien Gâteau's similar workaround in Gwenview (230aebbd)
if (qstrcmp(QApplication::style()->metaObject()->className(), "QGtkStyle") == 0)
{
QStyle* style = new QPlastiqueStyle();
style->setParent(this);
setStyle(style);
}
init(p);
}