137 qApp->setPalette(QPalette());
150 QString filename =
d->
themeMap.value(theme);
151 KSharedConfigPtr config = KSharedConfig::openConfig(filename);
153 QPalette
palette = qApp->palette();
154 QPalette::ColorGroup states[3] = { QPalette::Active, QPalette::Inactive, QPalette::Disabled };
158 for (
int i = 0; i < 3 ; ++i ) {
160 QPalette::ColorGroup state = states[i];
173 palette.setBrush(state, QPalette::HighlightedText, schemeSelection.
foreground());
191 qApp->setProperty(
"KDE_COLOR_SCHEME_PATH", filename);
225 QMap<QString, QAction*> actionMap;
226 for (
int i = 0; i < schemeFiles.size(); ++i) {
227 const QString filename = schemeFiles.at(i);
228 const QFileInfo info(filename);
229 KSharedConfigPtr config = KSharedConfig::openConfig(filename);
231 KConfigGroup group(config,
"General");
232 const QString name = group.readEntry(
"Name", info.completeBaseName());
234 action->setIcon(icon);
235 action->setCheckable(
true);
236 actionMap.insert(name, action);
243 action->setCheckable(
true);
244 actionMap.insert(
"System", action);
249 actionMapKeys.sort();
251 Q_FOREACH (
const QString& name, actionMapKeys) {
253 actionMap.value(name)->setChecked(
true);
262 const uchar bits1[] = { 0xff, 0xff, 0xff, 0x2c, 0x16, 0x0b };
263 const uchar bits2[] = { 0x68, 0x34, 0x1a, 0xff, 0xff, 0xff };
264 const QSize bitsSize(24, 2);
265 const QBitmap b1 = QBitmap::fromData(bitsSize, bits1);
266 const QBitmap b2 = QBitmap::fromData(bitsSize, bits2);
268 QPixmap pixmap(23, 16);
269 pixmap.fill(Qt::black);
271 KConfigGroup group(config,
"WM");
275 p.fillRect(2, 2, 5, 2, QBrush(windowScheme.
foreground().color(), b1));
279 p.fillRect(9, 2, 5, 2, QBrush(buttonScheme.
foreground().color(), b1));
281 p.fillRect(15, 1, 7, 7, group.readEntry(
"activeBackground", QColor(96, 148, 207)));
282 p.fillRect(16, 2, 5, 2, QBrush(group.readEntry(
"activeForeground", QColor(255, 255, 255)), b1));
286 p.fillRect(2, 12, 5, 2, QBrush(viewScheme.
foreground().color(), b2));
289 p.fillRect(8, 8, 7, 7, selectionScheme.
background());
290 p.fillRect(9, 12, 5, 2, QBrush(selectionScheme.
foreground().color(), b2));
292 p.fillRect(15, 8, 7, 7, group.readEntry(
"inactiveBackground", QColor(224, 223, 222)));
293 p.fillRect(16, 12, 5, 2, QBrush(group.readEntry(
"inactiveForeground", QColor(20, 19, 18)), b2));