summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-15 21:10:09 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-15 21:10:43 (GMT)
commit00ff22d632e2d047af12ec570aba8bb91c31fb1a (patch)
treec8a7f9849205f786a2d4cccd370888a9ad4a6bdc
parent09d14df42c0a1ba76058c1bc82285a7331a12023 (diff)
Use breeze dark color theme on first start if available and default theme is breeze
CCBUG: 346608
-rw-r--r--src/dialogs/wizard.cpp5
-rw-r--r--src/utils/thememanager.cpp14
-rw-r--r--src/utils/thememanager.h8
3 files changed, 22 insertions, 5 deletions
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();