Changeset View
Changeset View
Standalone View
Standalone View
kcms/krdb/krdb.cpp
Show First 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | 331 | { | |||
---|---|---|---|---|---|
335 | t << endl; | 335 | t << endl; | ||
336 | if (gtkStyle == QLatin1String("oxygen-gtk")) | 336 | if (gtkStyle == QLatin1String("oxygen-gtk")) | ||
337 | exportColors = false; | 337 | exportColors = false; | ||
338 | } | 338 | } | ||
339 | } | 339 | } | ||
340 | 340 | | |||
341 | } | 341 | } | ||
342 | 342 | | |||
343 | if (exportColors) | | |||
344 | { | | |||
345 | t << "style \"default\"" << endl; | | |||
346 | t << "{" << endl; | | |||
347 | t << " bg[NORMAL] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl; | | |||
348 | t << " bg[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl; | | |||
349 | t << " bg[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl; | | |||
350 | t << " bg[ACTIVE] = " << color( cg.color( QPalette::Active, QPalette::Mid ) ) << endl; | | |||
351 | t << " bg[PRELIGHT] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl; | | |||
352 | t << endl; | | |||
353 | t << " base[NORMAL] = " << color( cg.color( QPalette::Active, QPalette::Base ) ) << endl; | | |||
354 | t << " base[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl; | | |||
355 | t << " base[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl; | | |||
356 | t << " base[ACTIVE] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl; | | |||
357 | t << " base[PRELIGHT] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl; | | |||
358 | t << endl; | | |||
359 | t << " text[NORMAL] = " << color( cg.color(QPalette::Active, QPalette::Text) ) << endl; | | |||
360 | t << " text[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl; | | |||
361 | t << " text[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Mid ) ) << endl; | | |||
362 | t << " text[ACTIVE] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl; | | |||
363 | t << " text[PRELIGHT] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl; | | |||
364 | t << endl; | | |||
365 | t << " fg[NORMAL] = " << color ( cg.color( QPalette::Active, QPalette::WindowText ) ) << endl; | | |||
366 | t << " fg[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl; | | |||
367 | t << " fg[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Mid ) ) << endl; | | |||
368 | t << " fg[ACTIVE] = " << color( cg.color( QPalette::Active, QPalette::WindowText ) ) << endl; | | |||
369 | t << " fg[PRELIGHT] = " << color( cg.color( QPalette::Active, QPalette::WindowText ) ) << endl; | | |||
370 | t << "}" << endl; | | |||
371 | t << endl; | | |||
372 | t << "class \"*\" style \"default\"" << endl; | | |||
373 | t << endl; | | |||
374 | | ||||
375 | // tooltips don't have the standard background color | | |||
376 | t << "style \"ToolTip\"" << endl; | | |||
377 | t << "{" << endl; | | |||
378 | t << " bg[NORMAL] = " << color( cg.color( QPalette::ToolTipBase ) ) << endl; | | |||
379 | t << " base[NORMAL] = " << color( cg.color( QPalette::ToolTipBase ) ) << endl; | | |||
380 | t << " text[NORMAL] = " << color( cg.color( QPalette::ToolTipText ) ) << endl; | | |||
381 | t << " fg[NORMAL] = " << color( cg.color( QPalette::ToolTipText ) ) << endl; | | |||
382 | t << "}" << endl; | | |||
383 | t << endl; | | |||
384 | t << "widget \"gtk-tooltip\" style \"ToolTip\"" << endl; | | |||
385 | t << "widget \"gtk-tooltips\" style \"ToolTip\"" << endl; | | |||
386 | t << "widget \"gtk-tooltip*\" style \"ToolTip\"" << endl; | | |||
387 | t << endl; | | |||
388 | | ||||
389 | | ||||
390 | // highlight the current (mouse-hovered) menu-item | | |||
391 | // not every button, checkbox, etc. | | |||
392 | t << "style \"MenuItem\"" << endl; | | |||
393 | t << "{" << endl; | | |||
394 | t << " bg[PRELIGHT] = " << color( cg.color(QPalette::Highlight) ) << endl; | | |||
395 | t << " fg[PRELIGHT] = " << color( cg.color(QPalette::HighlightedText) ) << endl; | | |||
396 | t << "}" << endl; | | |||
397 | t << endl; | | |||
398 | t << "class \"*MenuItem\" style \"MenuItem\"" << endl; | | |||
399 | t << endl; | | |||
400 | } | | |||
401 | saveFile.commit(); | 343 | saveFile.commit(); | ||
402 | } | 344 | } | ||
403 | 345 | | |||
404 | // --------------------------------------------------------------------- | 346 | // --------------------------------------------------------------------- | ||
405 | 347 | | |||
406 | QString gtkColorsHelper(const QString &name, const QString &color) | 348 | QString gtkColorsHelper(const QString &name, const QString &color) | ||
407 | { | 349 | { | ||
408 | return QStringLiteral("@define-color %1 %2;\n").arg(name, color); | 350 | return QStringLiteral("@define-color %1 %2;\n").arg(name, color); | ||
▲ Show 20 Lines • Show All 582 Lines • Show Last 20 Lines |