Changeset View
Changeset View
Standalone View
Standalone View
kcms/krdb/krdb.cpp
Show First 20 Lines • Show All 393 Lines • ▼ Show 20 Line(s) | 342 | { | |||
---|---|---|---|---|---|
394 | t << "}" << endl; | 394 | t << "}" << endl; | ||
395 | t << endl; | 395 | t << endl; | ||
396 | t << "class \"*MenuItem\" style \"MenuItem\"" << endl; | 396 | t << "class \"*MenuItem\" style \"MenuItem\"" << endl; | ||
397 | t << endl; | 397 | t << endl; | ||
398 | } | 398 | } | ||
399 | saveFile.commit(); | 399 | saveFile.commit(); | ||
400 | } | 400 | } | ||
401 | 401 | | |||
402 | // --------------------------------------------------------------------- | | |||
403 | | ||||
404 | QString gtkColorsHelper(const QString &name, const QString &color) | | |||
405 | { | | |||
406 | return QStringLiteral("@define-color %1 %2;\n").arg(name, color); | | |||
407 | } | | |||
408 | void checkGtkCss() | | |||
409 | { | | |||
410 | QFile gtkCss(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/gtk-3.0/gtk.css"); | | |||
411 | if (gtkCss.open(QIODevice::ReadWrite)) { | | |||
412 | QTextStream gtkStream(>kCss); | | |||
413 | bool hasImport = false; | | |||
414 | while (!gtkStream.atEnd()) { | | |||
415 | QString line = gtkStream.readLine(); | | |||
416 | if (line.contains("@import 'colors.css';")) { | | |||
417 | hasImport = true; | | |||
418 | } | | |||
419 | } | | |||
420 | if (!hasImport) { | | |||
421 | gtkStream << "@import 'colors.css';"; | | |||
422 | } | | |||
423 | } | | |||
424 | } | | |||
425 | void exportGtkColors(QList<KColorScheme> activeColorSchemes, QList<KColorScheme> inactiveColorSchemes, QList<KColorScheme> disabledColorSchemes, KConfigGroup groupWMTheme, QTextStream& colorsStream) | | |||
426 | { | | |||
427 | /* | | |||
428 | Normal (Non Backdrop, Non Insensitive) | | |||
429 | */ | | |||
430 | | ||||
431 | // General Colors | | |||
432 | | ||||
433 | colorsStream << gtkColorsHelper("theme_fg_color_breeze", activeColorSchemes[1].foreground(KColorScheme::NormalText).color().name()); | | |||
434 | colorsStream << gtkColorsHelper("theme_bg_color_breeze", activeColorSchemes[1].background(KColorScheme::NormalBackground).color().name()); | | |||
435 | colorsStream << gtkColorsHelper("theme_text_color_breeze", activeColorSchemes[0].foreground(KColorScheme::NormalText).color().name()); | | |||
436 | colorsStream << gtkColorsHelper("theme_base_color_breeze", activeColorSchemes[0].background(KColorScheme::NormalBackground).color().name()); | | |||
437 | colorsStream << gtkColorsHelper("theme_view_hover_decoration_color_breeze", activeColorSchemes[0].decoration(KColorScheme::HoverColor).color().name()); | | |||
438 | colorsStream << gtkColorsHelper("theme_hovering_selected_bg_color_breeze", activeColorSchemes[3].decoration(KColorScheme::HoverColor).color().name()); | | |||
439 | colorsStream << gtkColorsHelper("theme_selected_bg_color_breeze", activeColorSchemes[3].background(KColorScheme::NormalBackground).color().name()); | | |||
440 | colorsStream << gtkColorsHelper("theme_selected_fg_color_breeze", activeColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
441 | colorsStream << gtkColorsHelper("theme_view_active_decoration_color_breeze", activeColorSchemes[0].decoration(KColorScheme::HoverColor).color().name()); | | |||
442 | | ||||
443 | // Button Colors | | |||
444 | colorsStream << gtkColorsHelper("theme_button_background_normal_breeze", activeColorSchemes[2].background(KColorScheme::NormalBackground).color().name()); | | |||
445 | colorsStream << gtkColorsHelper("theme_button_decoration_hover_breeze", activeColorSchemes[2].decoration(KColorScheme::HoverColor).color().name()); | | |||
446 | colorsStream << gtkColorsHelper("theme_button_decoration_focus_breeze", activeColorSchemes[2].decoration(KColorScheme::FocusColor).color().name()); | | |||
447 | colorsStream << gtkColorsHelper("theme_button_foreground_normal_breeze", activeColorSchemes[2].foreground(KColorScheme::NormalText).color().name()); | | |||
448 | colorsStream << gtkColorsHelper("theme_button_foreground_active_breeze", activeColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
449 | | ||||
450 | // Misc Colors | | |||
451 | QColor windowForegroundColor = activeColorSchemes[1].foreground(KColorScheme::NormalText).color(); | | |||
452 | QColor windowBackgroundColor = activeColorSchemes[1].background(KColorScheme::NormalBackground).color(); | | |||
453 | QColor bordersColor = KColorUtils::mix(windowBackgroundColor,windowForegroundColor, 0.25); | | |||
454 | | ||||
455 | colorsStream << gtkColorsHelper("borders_breeze", bordersColor.name()); | | |||
456 | colorsStream << gtkColorsHelper("warning_color_breeze", activeColorSchemes[0].foreground(KColorScheme::NeutralText).color().name()); | | |||
457 | colorsStream << gtkColorsHelper("success_color_breeze", activeColorSchemes[0].foreground(KColorScheme::PositiveText).color().name()); | | |||
458 | colorsStream << gtkColorsHelper("error_color_breeze", activeColorSchemes[0].foreground(KColorScheme::NegativeText).color().name()); | | |||
459 | | ||||
460 | /* | | |||
461 | Backdrop (Inactive) | | |||
462 | */ | | |||
463 | | ||||
464 | // General | | |||
465 | colorsStream << gtkColorsHelper("theme_unfocused_fg_color_breeze",inactiveColorSchemes[1].foreground(KColorScheme::NormalText).color().name()); | | |||
466 | colorsStream << gtkColorsHelper("theme_unfocused_text_color_breeze", inactiveColorSchemes[0].foreground(KColorScheme::NormalText).color().name()); | | |||
467 | colorsStream << gtkColorsHelper("theme_unfocused_bg_color_breeze", inactiveColorSchemes[1].background(KColorScheme::NormalBackground).color().name()); | | |||
468 | colorsStream << gtkColorsHelper("theme_unfocused_base_color_breeze", inactiveColorSchemes[0].background(KColorScheme::NormalBackground).color().name()); | | |||
469 | colorsStream << gtkColorsHelper("theme_unfocused_selected_bg_color_alt_breeze", inactiveColorSchemes[3].background(KColorScheme::NormalBackground).color().name()); | | |||
470 | colorsStream << gtkColorsHelper("theme_unfocused_selected_bg_color_breeze", inactiveColorSchemes[3].background(KColorScheme::NormalBackground).color().name()); | | |||
471 | colorsStream << gtkColorsHelper("theme_unfocused_selected_fg_color_breeze", inactiveColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
472 | | ||||
473 | // Button | | |||
474 | colorsStream << gtkColorsHelper("theme_button_background_backdrop_breeze", inactiveColorSchemes[2].background(KColorScheme::NormalBackground).color().name()); | | |||
475 | colorsStream << gtkColorsHelper("theme_button_decoration_hover_backdrop_breeze", inactiveColorSchemes[2].decoration(KColorScheme::HoverColor).color().name()); | | |||
476 | colorsStream << gtkColorsHelper("theme_button_decoration_focus_backdrop_breeze", inactiveColorSchemes[2].decoration(KColorScheme::FocusColor).color().name()); | | |||
477 | colorsStream << gtkColorsHelper("theme_button_foreground_backdrop_breeze", inactiveColorSchemes[2].foreground(KColorScheme::NormalText).color().name()); | | |||
478 | colorsStream << gtkColorsHelper("theme_button_foreground_active_backdrop_breeze", inactiveColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
479 | | ||||
480 | // Misc Colors | | |||
481 | QColor inactiveWindowForegroundColor = inactiveColorSchemes[1].foreground(KColorScheme::NormalText).color(); | | |||
482 | QColor inactiveWindowBackgroundColor = inactiveColorSchemes[1].background(KColorScheme::NormalBackground).color(); | | |||
483 | QColor inactiveBordersColor = KColorUtils::mix(inactiveWindowBackgroundColor,inactiveWindowForegroundColor, 0.25); | | |||
484 | | ||||
485 | colorsStream << gtkColorsHelper("unfocused_borders_breeze", inactiveBordersColor.name()); | | |||
486 | colorsStream << gtkColorsHelper("warning_color_backdrop_breeze", inactiveColorSchemes[0].foreground(KColorScheme::NeutralText).color().name()); | | |||
487 | colorsStream << gtkColorsHelper("success_color_backdrop_breeze", inactiveColorSchemes[0].foreground(KColorScheme::PositiveText).color().name()); | | |||
488 | colorsStream << gtkColorsHelper("error_color_backdrop_breeze", inactiveColorSchemes[0].foreground(KColorScheme::NegativeText).color().name()); | | |||
489 | | ||||
490 | /* | | |||
491 | Insensitive (Disabled) | | |||
492 | */ | | |||
493 | | ||||
494 | // General | | |||
495 | colorsStream << gtkColorsHelper("insensitive_fg_color_breeze",disabledColorSchemes[1].foreground(KColorScheme::NormalText).color().name()); | | |||
496 | colorsStream << gtkColorsHelper("insensitive_base_fg_color_breeze", disabledColorSchemes[0].foreground(KColorScheme::NormalText).color().name()); | | |||
497 | colorsStream << gtkColorsHelper("insensitive_bg_color_breeze", disabledColorSchemes[1].background(KColorScheme::NormalBackground).color().name()); | | |||
498 | colorsStream << gtkColorsHelper("insensitive_base_color_breeze", disabledColorSchemes[0].background(KColorScheme::NormalBackground).color().name()); | | |||
499 | colorsStream << gtkColorsHelper("insensitive_selected_bg_color_breeze", disabledColorSchemes[3].background(KColorScheme::NormalBackground).color().name()); | | |||
500 | colorsStream << gtkColorsHelper("insensitive_selected_fg_color_breeze", disabledColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
501 | | ||||
502 | // Button | | |||
503 | colorsStream << gtkColorsHelper("theme_button_background_insensitive_breeze", disabledColorSchemes[2].background(KColorScheme::NormalBackground).color().name()); | | |||
504 | colorsStream << gtkColorsHelper("theme_button_decoration_hover_insensitive_breeze", disabledColorSchemes[2].decoration(KColorScheme::HoverColor).color().name()); | | |||
505 | colorsStream << gtkColorsHelper("theme_button_decoration_focus_insensitive_breeze", disabledColorSchemes[2].decoration(KColorScheme::FocusColor).color().name()); | | |||
506 | colorsStream << gtkColorsHelper("theme_button_foreground_insensitive_breeze", disabledColorSchemes[2].foreground(KColorScheme::NormalText).color().name()); | | |||
507 | colorsStream << gtkColorsHelper("theme_button_foreground_active_insensitive_breeze", disabledColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
508 | | ||||
509 | // Misc Colors | | |||
510 | QColor disabledWindowForegroundColor = disabledColorSchemes[1].foreground(KColorScheme::NormalText).color(); | | |||
511 | QColor disabledWindowBackgroundColor = disabledColorSchemes[1].background(KColorScheme::NormalBackground).color(); | | |||
512 | QColor disabledBordersColor = KColorUtils::mix(disabledWindowBackgroundColor,disabledWindowForegroundColor, 0.25); | | |||
513 | | ||||
514 | colorsStream << gtkColorsHelper("insensitive_borders_breeze", disabledBordersColor.name()); | | |||
515 | colorsStream << gtkColorsHelper("warning_color_insensitive_breeze", disabledColorSchemes[0].foreground(KColorScheme::NeutralText).color().name()); | | |||
516 | colorsStream << gtkColorsHelper("success_color_insensitive_breeze", disabledColorSchemes[0].foreground(KColorScheme::PositiveText).color().name()); | | |||
517 | colorsStream << gtkColorsHelper("error_color_insensitive_breeze", disabledColorSchemes[0].foreground(KColorScheme::NegativeText).color().name()); | | |||
518 | | ||||
519 | /* | | |||
520 | Insensitive Backdrop (Inactive Disabled) These pretty much have the same appearance as regular inactive colors, but they're separate in case we decide to make | | |||
521 | them different in the future. | | |||
522 | */ | | |||
523 | | ||||
524 | // General | | |||
525 | colorsStream << gtkColorsHelper("insensitive_unfocused_fg_color_breeze",disabledColorSchemes[1].foreground(KColorScheme::NormalText).color().name()); | | |||
526 | colorsStream << gtkColorsHelper("theme_unfocused_view_text_color_breeze", disabledColorSchemes[0].foreground(KColorScheme::NormalText).color().name()); | | |||
527 | colorsStream << gtkColorsHelper("insensitive_unfocused_bg_color_breeze", disabledColorSchemes[1].background(KColorScheme::NormalBackground).color().name()); | | |||
528 | colorsStream << gtkColorsHelper("theme_unfocused_view_bg_color_breeze", disabledColorSchemes[0].background(KColorScheme::NormalBackground).color().name()); | | |||
529 | colorsStream << gtkColorsHelper("insensitive_unfocused_selected_bg_color_breeze", disabledColorSchemes[3].background(KColorScheme::NormalBackground).color().name()); | | |||
530 | colorsStream << gtkColorsHelper("insensitive_unfocused_selected_fg_color_breeze", disabledColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
531 | | ||||
532 | // Button | | |||
533 | colorsStream << gtkColorsHelper("theme_button_background_backdrop_insensitive_breeze", disabledColorSchemes[2].background(KColorScheme::NormalBackground).color().name()); | | |||
534 | colorsStream << gtkColorsHelper("theme_button_decoration_hover_backdrop_insensitive_breeze", disabledColorSchemes[2].decoration(KColorScheme::HoverColor).color().name()); | | |||
535 | colorsStream << gtkColorsHelper("theme_button_decoration_focus_backdrop_insensitive_breeze", disabledColorSchemes[2].decoration(KColorScheme::FocusColor).color().name()); | | |||
536 | colorsStream << gtkColorsHelper("theme_button_foreground_backdrop_insensitive_breeze", disabledColorSchemes[2].foreground(KColorScheme::NormalText).color().name()); | | |||
537 | colorsStream << gtkColorsHelper("theme_button_foreground_active_backdrop_insensitive_breeze", disabledColorSchemes[3].foreground(KColorScheme::NormalText).color().name()); | | |||
538 | | ||||
539 | // Misc Colors | | |||
540 | QColor unfocusedDisabledWindowForegroundColor = disabledColorSchemes[1].foreground(KColorScheme::NormalText).color(); | | |||
541 | QColor unfocusedDisabledWindowBackgroundColor = disabledColorSchemes[1].background(KColorScheme::NormalBackground).color(); | | |||
542 | QColor unfocusedDisabledBordersColor = KColorUtils::mix(unfocusedDisabledWindowBackgroundColor,unfocusedDisabledWindowForegroundColor, 0.25); | | |||
543 | | ||||
544 | colorsStream << gtkColorsHelper("unfocused_insensitive_borders_breeze", unfocusedDisabledBordersColor.name()); | | |||
545 | colorsStream << gtkColorsHelper("warning_color_insensitive_backdrop_breeze", disabledColorSchemes[0].foreground(KColorScheme::NeutralText).color().name()); | | |||
546 | colorsStream << gtkColorsHelper("success_color_insensitive_backdrop_breeze", disabledColorSchemes[0].foreground(KColorScheme::PositiveText).color().name()); | | |||
547 | colorsStream << gtkColorsHelper("error_color_insensitive_backdrop_breeze", disabledColorSchemes[0].foreground(KColorScheme::NegativeText).color().name()); | | |||
548 | | ||||
549 | /* | | |||
550 | Ignorant Colors (These colors do not care about backdrop or insensitive states) | | |||
551 | */ | | |||
552 | | ||||
553 | colorsStream << gtkColorsHelper("link_color_breeze", activeColorSchemes[0].foreground(KColorScheme::LinkText).color().name()); | | |||
554 | colorsStream << gtkColorsHelper("link_visited_color_breeze", activeColorSchemes[0].foreground(KColorScheme::VisitedText).color().name()); | | |||
555 | | ||||
556 | QColor tooltipForegroundColor = activeColorSchemes[4].foreground(KColorScheme::NormalText).color(); | | |||
557 | QColor tooltipBackgroundColor = activeColorSchemes[4].background(KColorScheme::NormalBackground).color(); | | |||
558 | QColor tooltipBorderColor = KColorUtils::mix(tooltipBackgroundColor, tooltipForegroundColor, 0.25); | | |||
559 | | ||||
560 | colorsStream << gtkColorsHelper("tooltip_text_breeze", tooltipForegroundColor.name()); | | |||
561 | colorsStream << gtkColorsHelper("tooltip_background_breeze", tooltipBackgroundColor.name()); | | |||
562 | colorsStream << gtkColorsHelper("tooltip_border_breeze", tooltipBorderColor.name()); | | |||
563 | | ||||
564 | colorsStream << gtkColorsHelper("content_view_bg_breeze", activeColorSchemes[0].background(KColorScheme::NormalBackground).color().name()); | | |||
565 | | ||||
566 | // Titlebar colors | | |||
567 | colorsStream << gtkColorsHelper("theme_titlebar_background_breeze", "rgb(" + groupWMTheme.readEntry("activeBackground", "") + QLatin1Char(')')); | | |||
568 | colorsStream << gtkColorsHelper("theme_titlebar_foreground_breeze", "rgb(" + groupWMTheme.readEntry("activeForeground", "") + QLatin1Char(')')); | | |||
569 | colorsStream << gtkColorsHelper("theme_titlebar_background_light_breeze", activeColorSchemes[1].background(KColorScheme::NormalBackground).color().name()); | | |||
570 | colorsStream << gtkColorsHelper("theme_titlebar_foreground_backdrop_breeze", "rgb(" + groupWMTheme.readEntry("inactiveForeground", "") + QLatin1Char(')')); | | |||
571 | colorsStream << gtkColorsHelper("theme_titlebar_background_backdrop_breeze", "rgb(" + groupWMTheme.readEntry("inactiveBackground", "") + QLatin1Char(')')); | | |||
572 | colorsStream << gtkColorsHelper("theme_titlebar_foreground_insensitive_breeze", "rgb(" + groupWMTheme.readEntry("inactiveForeground", "") + QLatin1Char(')')); | | |||
573 | colorsStream << gtkColorsHelper("theme_titlebar_foreground_insensitive_backdrop_breeze", "rgb(" + groupWMTheme.readEntry("inactiveForeground", "") + QLatin1Char(')')); | | |||
574 | } | | |||
575 | void saveGtkColors(KSharedConfigPtr& config) | | |||
576 | { | | |||
577 | checkGtkCss(); | | |||
578 | QFile colorsCss(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/gtk-3.0/colors.css"); | | |||
579 | | ||||
580 | if (colorsCss.open(QIODevice::WriteOnly | QIODevice::Truncate)) { | | |||
581 | QTextStream colorsStream(&colorsCss); | | |||
582 | /* | | |||
583 | 0 Active View | | |||
584 | 1 Active Window | | |||
585 | 2 Active Button | | |||
586 | 3 Active Selection | | |||
587 | 4 Active Tooltip | | |||
588 | 5 Active Complimentary | | |||
589 | */ | | |||
590 | | ||||
591 | QList<KColorScheme> activeColorSchemes{ | | |||
592 | KColorScheme(QPalette::Active, KColorScheme::View, config), | | |||
593 | KColorScheme(QPalette::Active, KColorScheme::Window, config), | | |||
594 | KColorScheme(QPalette::Active, KColorScheme::Button, config), | | |||
595 | KColorScheme(QPalette::Active, KColorScheme::Selection, config), | | |||
596 | KColorScheme(QPalette::Active, KColorScheme::Tooltip, config), | | |||
597 | KColorScheme(QPalette::Active, KColorScheme::Complementary, config) | | |||
598 | }; | | |||
599 | QList<KColorScheme> inactiveColorSchemes{ | | |||
600 | KColorScheme(QPalette::Inactive, KColorScheme::View, config), | | |||
601 | KColorScheme(QPalette::Inactive, KColorScheme::Window, config), | | |||
602 | KColorScheme(QPalette::Inactive, KColorScheme::Button, config), | | |||
603 | KColorScheme(QPalette::Inactive, KColorScheme::Selection, config), | | |||
604 | KColorScheme(QPalette::Inactive, KColorScheme::Tooltip, config), | | |||
605 | KColorScheme(QPalette::Inactive, KColorScheme::Complementary, config) | | |||
606 | }; | | |||
607 | QList<KColorScheme> disabledColorSchemes{ | | |||
608 | KColorScheme(QPalette::Disabled, KColorScheme::View, config), | | |||
609 | KColorScheme(QPalette::Disabled, KColorScheme::Window, config), | | |||
610 | KColorScheme(QPalette::Disabled, KColorScheme::Button, config), | | |||
611 | KColorScheme(QPalette::Disabled, KColorScheme::Selection, config), | | |||
612 | KColorScheme(QPalette::Disabled, KColorScheme::Tooltip, config), | | |||
613 | KColorScheme(QPalette::Disabled, KColorScheme::Complementary, config) | | |||
614 | }; | | |||
615 | KConfigGroup groupWMTheme(config, "WM"); | | |||
616 | exportGtkColors(activeColorSchemes, inactiveColorSchemes, disabledColorSchemes, groupWMTheme, colorsStream); | | |||
617 | } | | |||
618 | } | | |||
619 | | ||||
620 | void saveGtkColors() | | |||
621 | { | | |||
622 | checkGtkCss(); | | |||
623 | QFile colorsCss(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/gtk-3.0/colors.css"); | | |||
624 | KConfigGroup groupWMTheme(KSharedConfig::openConfig(), "WM"); | | |||
625 | | ||||
626 | if (colorsCss.open(QIODevice::WriteOnly | QIODevice::Truncate)) { | | |||
627 | QTextStream colorsStream(&colorsCss); | | |||
628 | /* | | |||
629 | 0 Active View | | |||
630 | 1 Active Window | | |||
631 | 2 Active Button | | |||
632 | 3 Active Selection | | |||
633 | 4 Active Tooltip | | |||
634 | 5 Active Complimentary | | |||
635 | */ | | |||
636 | | ||||
637 | QList<KColorScheme> activeColorSchemes{ | | |||
638 | KColorScheme(QPalette::Active, KColorScheme::View), | | |||
639 | KColorScheme(QPalette::Active, KColorScheme::Window), | | |||
640 | KColorScheme(QPalette::Active, KColorScheme::Button), | | |||
641 | KColorScheme(QPalette::Active, KColorScheme::Selection), | | |||
642 | KColorScheme(QPalette::Active, KColorScheme::Tooltip), | | |||
643 | KColorScheme(QPalette::Active, KColorScheme::Complementary) | | |||
644 | }; | | |||
645 | QList<KColorScheme> inactiveColorSchemes{ | | |||
646 | KColorScheme(QPalette::Inactive, KColorScheme::View), | | |||
647 | KColorScheme(QPalette::Inactive, KColorScheme::Window), | | |||
648 | KColorScheme(QPalette::Inactive, KColorScheme::Button), | | |||
649 | KColorScheme(QPalette::Inactive, KColorScheme::Selection), | | |||
650 | KColorScheme(QPalette::Inactive, KColorScheme::Tooltip), | | |||
651 | KColorScheme(QPalette::Inactive, KColorScheme::Complementary) | | |||
652 | }; | | |||
653 | QList<KColorScheme> disabledColorSchemes{ | | |||
654 | KColorScheme(QPalette::Disabled, KColorScheme::View), | | |||
655 | KColorScheme(QPalette::Disabled, KColorScheme::Window), | | |||
656 | KColorScheme(QPalette::Disabled, KColorScheme::Button), | | |||
657 | KColorScheme(QPalette::Disabled, KColorScheme::Selection), | | |||
658 | KColorScheme(QPalette::Disabled, KColorScheme::Tooltip), | | |||
659 | KColorScheme(QPalette::Disabled, KColorScheme::Complementary) | | |||
660 | }; | | |||
661 | | ||||
662 | exportGtkColors(activeColorSchemes, inactiveColorSchemes, disabledColorSchemes, groupWMTheme, colorsStream); | | |||
663 | } | | |||
664 | } | | |||
665 | | ||||
666 | // ----------------------------------------------------------------------------- | 402 | // ----------------------------------------------------------------------------- | ||
667 | 403 | | |||
668 | void runRdb( uint flags ) | 404 | void runRdb( uint flags ) | ||
669 | { | 405 | { | ||
670 | // Obtain the application palette that is about to be set. | 406 | // Obtain the application palette that is about to be set. | ||
671 | bool exportColors = flags & KRdbExportColors; | 407 | bool exportColors = flags & KRdbExportColors; | ||
672 | bool exportQtColors = flags & KRdbExportQtColors; | 408 | bool exportQtColors = flags & KRdbExportQtColors; | ||
673 | bool exportQtSettings = flags & KRdbExportQtSettings; | 409 | bool exportQtSettings = flags & KRdbExportQtSettings; | ||
674 | bool exportXftSettings = flags & KRdbExportXftSettings; | 410 | bool exportXftSettings = flags & KRdbExportXftSettings; | ||
675 | bool exportGtkTheme = flags & KRdbExportGtkTheme; | 411 | bool exportGtkTheme = flags & KRdbExportGtkTheme; | ||
676 | bool exportGtkColors = flags & KRdbExportGtkColors; | | |||
677 | 412 | | |||
678 | KSharedConfigPtr kglobalcfg = KSharedConfig::openConfig( QStringLiteral("kdeglobals") ); | 413 | KSharedConfigPtr kglobalcfg = KSharedConfig::openConfig( QStringLiteral("kdeglobals") ); | ||
679 | KConfigGroup kglobals(kglobalcfg, "KDE"); | 414 | KConfigGroup kglobals(kglobalcfg, "KDE"); | ||
680 | QPalette newPal = KColorScheme::createApplicationPalette(kglobalcfg); | 415 | QPalette newPal = KColorScheme::createApplicationPalette(kglobalcfg); | ||
681 | 416 | | |||
682 | QTemporaryFile tmpFile; | 417 | QTemporaryFile tmpFile; | ||
683 | if (!tmpFile.open()) | 418 | if (!tmpFile.open()) | ||
684 | { | 419 | { | ||
▲ Show 20 Lines • Show All 288 Lines • ▼ Show 20 Line(s) | 612 | #endif | |||
973 | //FIXME: this should somehow check if the kde4 version of the style is installed | 708 | //FIXME: this should somehow check if the kde4 version of the style is installed | ||
974 | kde4generalGroup.writeEntry("widgetStyle", kglobals.readEntry("widgetStyle", "breeze")); | 709 | kde4generalGroup.writeEntry("widgetStyle", kglobals.readEntry("widgetStyle", "breeze")); | ||
975 | 710 | | |||
976 | //toolbar style | 711 | //toolbar style | ||
977 | KConfigGroup toolbars4(&kde4config, "Toolbar style"); | 712 | KConfigGroup toolbars4(&kde4config, "Toolbar style"); | ||
978 | KConfigGroup toolbars5(kglobalcfg, "Toolbar style"); | 713 | KConfigGroup toolbars5(kglobalcfg, "Toolbar style"); | ||
979 | toolbars4.writeEntry("ToolButtonStyle", toolbars5.readEntry("ToolButtonStyle", "TextBesideIcon")); | 714 | toolbars4.writeEntry("ToolButtonStyle", toolbars5.readEntry("ToolButtonStyle", "TextBesideIcon")); | ||
980 | toolbars4.writeEntry("ToolButtonStyleOtherToolbars", toolbars5.readEntry("ToolButtonStyleOtherToolbars", "TextBesideIcon")); | 715 | toolbars4.writeEntry("ToolButtonStyleOtherToolbars", toolbars5.readEntry("ToolButtonStyleOtherToolbars", "TextBesideIcon")); | ||
981 | | ||||
982 | if (exportGtkColors) { | | |||
983 | saveGtkColors(); | | |||
984 | } | | |||
985 | } | 716 | } |