[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdenlive] src: Use breeze dark color theme on first start if available and default theme is breeze
From: Jean-Baptiste Mardelle <jb () kdenlive ! org>
Date: 2016-11-15 21:11:42
Message-ID: E1c6l14-0002VU-8O () code ! kde ! org
[Download RAW message or body]
Git commit 00ff22d632e2d047af12ec570aba8bb91c31fb1a by Jean-Baptiste Mardelle.
Committed on 15/11/2016 at 21:10.
Pushed by mardelle into branch 'master'.
Use breeze dark color theme on first start if available and default theme is breeze
CCBUG: 346608
M +4 -1 src/dialogs/wizard.cpp
M +13 -1 src/utils/thememanager.cpp
M +5 -3 src/utils/thememanager.h
http://commits.kde.org/kdenlive/00ff22d632e2d047af12ec570aba8bb91c31fb1a
diff --git a/src/dialogs/wizard.cpp b/src/dialogs/wizard.cpp
index 38691d0..3c1819d 100644
--- a/src/dialogs/wizard.cpp
+++ b/src/dialogs/wizard.cpp
@@ -22,6 +22,7 @@
#include "utils/KoIconUtils.h"
#include "kdenlivesettings.h"
#include "renderer.h"
+#include "utils/thememanager.h"
#ifdef USE_V4L
#include "capture/v4lcapture.h"
#endif
@@ -72,7 +73,9 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
QWizard(parent),
m_systemCheckIsOk(false),
m_brokenModule(false)
-{
+{
+ // Check color theme
+ ThemeManager::instance()->initDarkTheme();
setWindowTitle(i18n("Welcome to Kdenlive"));
int logoHeight = fontMetrics().height() * 2.5;
setWizardStyle(QWizard::ModernStyle);
diff --git a/src/utils/thememanager.cpp b/src/utils/thememanager.cpp
index c4cac4f..33c18bb 100644
--- a/src/utils/thememanager.cpp
+++ b/src/utils/thememanager.cpp
@@ -48,7 +48,7 @@
#include <KColorScheme>
#include <ktoolinvocation.h>
#include "thememanager.h"
-
+#include "kdenlivesettings.h"
class ThemeManagerCreator
{
@@ -296,3 +296,15 @@ void ThemeManager::slotSettingsChanged()
slotChangePalette();
}
+void ThemeManager::initDarkTheme()
+{
+ QString defaultTheme = currentKDEdefaultTheme();
+ if (defaultTheme.isEmpty() || defaultTheme == QLatin1String("Breeze")) {
+ // Switch to breeze dark if available
+ if (d->themeMap.contains(QStringLiteral("Breeze Dark"))) {
+ KdenliveSettings::setColortheme(d->themeMap.value(QStringLiteral("Breeze Dark")));
+ setCurrentTheme(KdenliveSettings::colortheme());
+ slotChangePalette();
+ }
+ }
+}
diff --git a/src/utils/thememanager.h b/src/utils/thememanager.h
index 94606cf..a42877e 100644
--- a/src/utils/thememanager.h
+++ b/src/utils/thememanager.h
@@ -52,16 +52,18 @@ public:
static ThemeManager* instance();
QString currentThemeName() const;
- void setCurrentTheme(const QString& name);
+ void setCurrentTheme(const QString& name);
QString defaultThemeName() const;
- void setThemeMenuAction(KActionMenu* const action);
+ void setThemeMenuAction(KActionMenu* const action);
+ /** @brief set dark theme by default if available */
+ void initDarkTheme();
Q_SIGNALS:
void signalThemeChanged(const QString&);
-
+
public Q_SLOTS:
void slotSettingsChanged();
void slotChangePalette();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic