Theming: allow to override base style

Change-Id: I48e2d03b83fccf3d6eb4b508bd77912dbdaea1d0
Reviewed-by: Thorben Kroeger <thorbenkroeger@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Thorben Kroeger
2014-10-20 22:32:55 +02:00
committed by Orgad Shaneh
parent 82bbc6f562
commit cf45c854e0
8 changed files with 27 additions and 1 deletions

View File

@@ -166,7 +166,18 @@ MainWindow::MainWindow() :
&& baseName == QLatin1String("windows")) {
baseName = QLatin1String("fusion");
}
qApp->setStyle(new ManhattanStyle(baseName));
// if the user has specified as base style in the theme settings,
// prefer that
const QStringList available = QStyleFactory::keys();
foreach (const QString &s, Utils::creatorTheme()->preferredStyles()) {
if (available.contains(s, Qt::CaseInsensitive)) {
baseName = s;
break;
}
}
QApplication::setStyle(new ManhattanStyle(baseName));
setDockNestingEnabled(true);