diff --git a/app/gvcore.h b/app/gvcore.h --- a/app/gvcore.h +++ b/app/gvcore.h @@ -33,6 +33,7 @@ class QAbstractItemModel; class QPalette; +class QString; namespace Gwenview { @@ -65,6 +66,7 @@ void addUrlToRecentFiles(const QUrl &); QPalette palette(PaletteType type) const; + QString fullScreenPaletteName() const; public Q_SLOTS: void saveAll(); diff --git a/app/gvcore.cpp b/app/gvcore.cpp --- a/app/gvcore.cpp +++ b/app/gvcore.cpp @@ -64,6 +64,7 @@ HistoryModel* mRecentFoldersModel; RecentFilesModel* mRecentFilesModel; QPalette mPalettes[4]; + QString mFullScreenPaletteName; bool showSaveAsDialog(const QUrl &url, QUrl* outUrl, QByteArray* format) { @@ -128,14 +129,16 @@ QString name = GwenviewConfig::fullScreenColorScheme(); if (name.isEmpty()) { // Default color scheme - QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, "color-schemes/fullscreen.colors"); - config = KSharedConfig::openConfig(path); + mFullScreenPaletteName = QStandardPaths::locate(QStandardPaths::AppDataLocation, "color-schemes/fullscreen.colors"); + config = KSharedConfig::openConfig(mFullScreenPaletteName); } else if (name.contains('/')) { // Full path to a .colors file - config = KSharedConfig::openConfig(name); + mFullScreenPaletteName = name; + config = KSharedConfig::openConfig(mFullScreenPaletteName); } else { // Standard KDE color scheme - config = KSharedConfig::openConfig(QString("color-schemes/%1.colors").arg(name), KConfig::FullConfig, QStandardPaths::AppDataLocation); + mFullScreenPaletteName = QString("color-schemes/%1.colors").arg(name); + config = KSharedConfig::openConfig(mFullScreenPaletteName, KConfig::FullConfig, QStandardPaths::AppDataLocation); } mPalettes[GvCore::FullScreenPalette] = KColorScheme::createApplicationPalette(config); @@ -375,4 +378,9 @@ return d->mPalettes[type]; } +QString GvCore::fullScreenPaletteName() const +{ + return d->mFullScreenPaletteName; +} + } // namespace diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -1278,7 +1278,9 @@ menuBar()->hide(); toolBar()->hide(); + qApp->setProperty("KDE_COLOR_SCHEME_PATH", d->mGvCore->fullScreenPaletteName()); QApplication::setPalette(d->mGvCore->palette(GvCore::FullScreenPalette)); + d->mFullScreenContent->setFullScreenMode(true); d->mBrowseMainPage->setFullScreenMode(true); d->mViewMainPage->setFullScreenMode(true); @@ -1293,7 +1295,9 @@ setAutoSaveSettings(); // Back to normal + qApp->setProperty("KDE_COLOR_SCHEME_PATH", QVariant()); QApplication::setPalette(d->mGvCore->palette(GvCore::NormalPalette)); + d->mFullScreenContent->setFullScreenMode(false); d->mBrowseMainPage->setFullScreenMode(false); d->mViewMainPage->setFullScreenMode(false);