Changeset View
Changeset View
Standalone View
Standalone View
app/gvcore.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | |||||
59 | struct GvCorePrivate | 59 | struct GvCorePrivate | ||
60 | { | 60 | { | ||
61 | GvCore* q; | 61 | GvCore* q; | ||
62 | MainWindow* mMainWindow; | 62 | MainWindow* mMainWindow; | ||
63 | SortedDirModel* mDirModel; | 63 | SortedDirModel* mDirModel; | ||
64 | HistoryModel* mRecentFoldersModel; | 64 | HistoryModel* mRecentFoldersModel; | ||
65 | RecentFilesModel* mRecentFilesModel; | 65 | RecentFilesModel* mRecentFilesModel; | ||
66 | QPalette mPalettes[4]; | 66 | QPalette mPalettes[4]; | ||
67 | QString mFullScreenPaletteName; | ||||
67 | 68 | | |||
68 | bool showSaveAsDialog(const QUrl &url, QUrl* outUrl, QByteArray* format) | 69 | bool showSaveAsDialog(const QUrl &url, QUrl* outUrl, QByteArray* format) | ||
69 | { | 70 | { | ||
70 | QFileDialog dialog(mMainWindow); | 71 | QFileDialog dialog(mMainWindow); | ||
71 | dialog.setAcceptMode(QFileDialog::AcceptSave); | 72 | dialog.setAcceptMode(QFileDialog::AcceptSave); | ||
72 | dialog.setWindowTitle(i18nc("@title:window", "Save Image")); | 73 | dialog.setWindowTitle(i18nc("@title:window", "Save Image")); | ||
73 | dialog.selectUrl(url); | 74 | dialog.selectUrl(url); | ||
74 | 75 | | |||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 114 | { | |||
123 | pal.setColor(QPalette::Base, QColor::fromHsv(0, 0, value)); | 124 | pal.setColor(QPalette::Base, QColor::fromHsv(0, 0, value)); | ||
124 | pal.setColor(QPalette::Text, fgColor); | 125 | pal.setColor(QPalette::Text, fgColor); | ||
125 | mPalettes[GvCore::NormalViewPalette] = pal; | 126 | mPalettes[GvCore::NormalViewPalette] = pal; | ||
126 | 127 | | |||
127 | // Fullscreen | 128 | // Fullscreen | ||
128 | QString name = GwenviewConfig::fullScreenColorScheme(); | 129 | QString name = GwenviewConfig::fullScreenColorScheme(); | ||
129 | if (name.isEmpty()) { | 130 | if (name.isEmpty()) { | ||
130 | // Default color scheme | 131 | // Default color scheme | ||
131 | QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, "color-schemes/fullscreen.colors"); | 132 | mFullScreenPaletteName = QStandardPaths::locate(QStandardPaths::AppDataLocation, "color-schemes/fullscreen.colors"); | ||
132 | config = KSharedConfig::openConfig(path); | 133 | config = KSharedConfig::openConfig(mFullScreenPaletteName); | ||
133 | } else if (name.contains('/')) { | 134 | } else if (name.contains('/')) { | ||
134 | // Full path to a .colors file | 135 | // Full path to a .colors file | ||
135 | config = KSharedConfig::openConfig(name); | 136 | mFullScreenPaletteName = name; | ||
137 | config = KSharedConfig::openConfig(mFullScreenPaletteName); | ||||
136 | } else { | 138 | } else { | ||
137 | // Standard KDE color scheme | 139 | // Standard KDE color scheme | ||
138 | config = KSharedConfig::openConfig(QString("color-schemes/%1.colors").arg(name), KConfig::FullConfig, QStandardPaths::AppDataLocation); | 140 | mFullScreenPaletteName = QString("color-schemes/%1.colors").arg(name); | ||
141 | config = KSharedConfig::openConfig(mFullScreenPaletteName, KConfig::FullConfig, QStandardPaths::AppDataLocation); | ||||
139 | } | 142 | } | ||
140 | mPalettes[GvCore::FullScreenPalette] = KColorScheme::createApplicationPalette(config); | 143 | mPalettes[GvCore::FullScreenPalette] = KColorScheme::createApplicationPalette(config); | ||
141 | 144 | | |||
142 | pal = mPalettes[GvCore::FullScreenPalette]; | 145 | pal = mPalettes[GvCore::FullScreenPalette]; | ||
143 | QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, "images/background.png"); | 146 | QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, "images/background.png"); | ||
144 | QPixmap bgTexture(path); | 147 | QPixmap bgTexture(path); | ||
145 | pal.setBrush(QPalette::Base, bgTexture); | 148 | pal.setBrush(QPalette::Base, bgTexture); | ||
146 | mPalettes[GvCore::FullScreenViewPalette] = pal; | 149 | mPalettes[GvCore::FullScreenViewPalette] = pal; | ||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Line(s) | 368 | { | |||
370 | d->setupPalettes(); | 373 | d->setupPalettes(); | ||
371 | } | 374 | } | ||
372 | 375 | | |||
373 | QPalette GvCore::palette(GvCore::PaletteType type) const | 376 | QPalette GvCore::palette(GvCore::PaletteType type) const | ||
374 | { | 377 | { | ||
375 | return d->mPalettes[type]; | 378 | return d->mPalettes[type]; | ||
376 | } | 379 | } | ||
377 | 380 | | |||
381 | QString GvCore::fullScreenPaletteName() const | ||||
382 | { | ||||
383 | return d->mFullScreenPaletteName; | ||||
384 | } | ||||
385 | | ||||
378 | } // namespace | 386 | } // namespace |