Commit b7d4afda authored by Bhushan Shah's avatar Bhushan Shah

Merge branch 'Applications/18.12'

parents b39395f5 3b1c2b8e
include:
- https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-before.yml
- https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-applications-linux.yml
......@@ -262,7 +262,7 @@
</ul>
</description>
<releases>
<release date="2018-10-11" version="18.08.2"/>
<release date="2018-12-13" version="18.12.0"/>
</releases>
<url type="homepage">https://kdenlive.org/</url>
<url type="bugtracker">https://bugs.kde.org</url>
......
......@@ -674,12 +674,11 @@ void MainWindow::init(const QString &MltPath, const QUrl &Url, const QString &cl
void MainWindow::slotThemeChanged(const QString &theme)
{
disconnect(this, &MainWindow::reloadTheme, this, &MainWindow::slotReloadTheme);
KdenliveSettings::setColortheme(theme);
KSharedConfigPtr config = KSharedConfig::openConfig(theme);
setPalette(KColorScheme::createApplicationPalette(config));
qApp->setPalette(palette());
QPalette plt = palette();
KdenliveSettings::setColortheme(theme);
if (m_effectStack) {
m_effectStack->updatePalette();
m_effectStack->transitionConfig()->updatePalette();
......
......@@ -115,14 +115,35 @@ void ThemeManager::setCurrentTheme(const QString &filename)
if (!d->themeMenuAction || !d->themeMenuActionGroup) {
return;
}
QString name = d->themeMap.key(filename, d->defaultThemeName);
QString name = d->themeMap.key(filename);
// In the case of AppImage, the path to the color scheme can be invalid
// on each start as filesystem is mounted with a random path, so check that and correct
if (name.isEmpty()) {
QMapIterator<QString, QString> i(d->themeMap);
while (i.hasNext()) {
i.next();
if (QFileInfo(i.value()).fileName() == QFileInfo(filename).fileName()) {
name = i.key();
break;
}
}
if (name.isEmpty()) {
name = d->defaultThemeName;
}
}
bool themeFound = false;
const QList<QAction *> list = d->themeMenuActionGroup->actions();
for (QAction *const action : list) {
if (action->text().remove('&') == name) {
action->setChecked(true);
themeFound = true;
break;
//slotChangePalette();
}
}
if (!themeFound && filename != d->defaultThemeName) {
setCurrentTheme(d->defaultThemeName);
}
}
void ThemeManager::slotChangePalette()
......@@ -138,7 +159,6 @@ void ThemeManager::slotChangePalette()
QString filename = d->themeMap.value(theme);
//qCDebug(KDENLIVE_LOG) << theme << " :: " << filename;
emit signalThemeChanged(filename);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment