From kde-commits Thu Dec 31 17:06:57 2015 From: Jean-Baptiste Mardelle Date: Thu, 31 Dec 2015 17:06:57 +0000 To: kde-commits Subject: [kdenlive] src: Activate breeze widget style by default if Desktop Session is not using Breeze or Ox Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145158163007461 Git commit 993f76888959cfe35670432edfd0e806f7462133 by Jean-Baptiste Mardel= le. Committed on 31/12/2015 at 17:06. Pushed by mardelle into branch 'master'. Activate breeze widget style by default if Desktop Session is not using Bre= eze or Oxygen style M +10 -1 src/mainwindow.cpp http://commits.kde.org/kdenlive/993f76888959cfe35670432edfd0e806f7462133 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 77e0036..d8a7bb1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -176,7 +176,16 @@ MainWindow::MainWindow(const QString &MltPath, const Q= Url &Url, const QString & ThemeManager::instance()->setThemeMenuAction(themeAction); ThemeManager::instance()->setCurrentTheme(KdenliveSettings::colortheme= ()); connect(ThemeManager::instance(), SIGNAL(signalThemeChanged(const QStr= ing &)), this, SLOT(slotThemeChanged(const QString &)), Qt::DirectConnectio= n); - if (!KdenliveSettings::widgetstyle().isEmpty()) { + + QString desktopStyle =3D QApplication::style()->objectName(); + if (!desktopStyle.isEmpty() && QString::compare(desktopStyle, QLatin1S= tring("breeze"), Qt::CaseInsensitive) !=3D 0 && QString::compare(desktopSty= le, QLatin1String("oxygen"), Qt::CaseInsensitive) !=3D 0 && KdenliveSetting= s::widgetstyle().isEmpty()) { + if (availableStyles.contains(QLatin1String("breeze"), Qt::CaseInse= nsitive)) { + // Auto switch to Breeze theme + KdenliveSettings::setWidgetstyle(QStringLiteral("Breeze")); + } + } + + if (!KdenliveSettings::widgetstyle().isEmpty() && QString::compare(des= ktopStyle, KdenliveSettings::widgetstyle(), Qt::CaseInsensitive) !=3D 0) { // User wants a custom widget style, init doChangeStyle(); }