File 0001-krdb-Drop-GTK2-colour-exporting.patch of Package plasma5-desktop.openSUSE_Leap_15.2_Update

From acf7b1d2278586b2b05c2e09866452be418edb49 Mon Sep 17 00:00:00 2001
From: Carson Black <uhhadd@gmail.com>
Date: Fri, 17 Apr 2020 11:45:04 -0400
Subject: [PATCH] [krdb] Drop GTK2 colour exporting

Summary:
With the vast supermajority of modern GTK2 themes using pixmaps, exporting colours
is only likely to result in breakage.

BUG: 412331
FIXED-IN: 5.19.0 (or should we consider this a bugfix and land it on the stable branch?)

Reviewers: #plasma, ngraham, gikari, davidedmundson

Reviewed By: #plasma, ngraham, davidedmundson

Subscribers: gikari, fvogt, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28658
---
 kcms/krdb/krdb.cpp | 66 +++-------------------------------------------
 1 file changed, 3 insertions(+), 63 deletions(-)

diff --git a/kcms/krdb/krdb.cpp b/kcms/krdb/krdb.cpp
index 82a51a032..30c7b2578 100644
--- a/kcms/krdb/krdb.cpp
+++ b/kcms/krdb/krdb.cpp
@@ -255,7 +255,7 @@ static QString color( const QColor& col )
     return QStringLiteral( "{ %1, %2, %3 }" ).arg( item( col.red() ) ).arg( item( col.green() ) ).arg( item( col.blue() ) );
 }
 
-static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTheme, const QString& gtkTheme, int version )
+static void createGtkrc( const QPalette& cg, bool exportGtkTheme, const QString& gtkTheme, int version )
 {
     // lukas: why does it create in ~/.kde/share/config ???
     // pfeiffer: so that we don't overwrite the user's gtkrc.
@@ -328,71 +328,11 @@ static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTh
                 t << endl;
                 t << "gtk-theme-name=\"" << gtkStyle << "\"" << endl;
                 t << endl;
-                if (gtkStyle == QLatin1String("oxygen-gtk"))
-                    exportColors = false;
             }
         }
 
     }
 
-    if (exportColors)
-    {
-        t << "style \"default\"" << endl;
-        t << "{" << endl;
-        t << "  bg[NORMAL] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl;
-        t << "  bg[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl;
-        t << "  bg[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl;
-        t << "  bg[ACTIVE] = " << color( cg.color( QPalette::Active, QPalette::Mid ) ) << endl;
-        t << "  bg[PRELIGHT] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl;
-        t << endl;
-        t << "  base[NORMAL] = " << color( cg.color( QPalette::Active, QPalette::Base ) ) << endl;
-        t << "  base[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl;
-        t << "  base[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Window ) ) << endl;
-        t << "  base[ACTIVE] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl;
-        t << "  base[PRELIGHT] = " << color( cg.color(QPalette::Active, QPalette::Highlight) ) << endl;
-        t << endl;
-        t << "  text[NORMAL] = " << color( cg.color(QPalette::Active, QPalette::Text) ) << endl;
-        t << "  text[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl;
-        t << "  text[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Mid ) ) << endl;
-        t << "  text[ACTIVE] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl;
-        t << "  text[PRELIGHT] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl;
-        t << endl;
-        t << "  fg[NORMAL] = " << color ( cg.color( QPalette::Active, QPalette::WindowText ) ) << endl;
-        t << "  fg[SELECTED] = " << color( cg.color(QPalette::Active, QPalette::HighlightedText) ) << endl;
-        t << "  fg[INSENSITIVE] = " << color( cg.color( QPalette::Active, QPalette::Mid ) ) << endl;
-        t << "  fg[ACTIVE] = " << color( cg.color( QPalette::Active, QPalette::WindowText ) ) << endl;
-        t << "  fg[PRELIGHT] = " << color( cg.color( QPalette::Active, QPalette::WindowText ) ) << endl;
-        t << "}" << endl;
-        t << endl;
-        t << "class \"*\" style \"default\"" << endl;
-        t << endl;
-
-        // tooltips don't have the standard background color
-        t << "style \"ToolTip\"" << endl;
-        t << "{" << endl;
-        t << "  bg[NORMAL] = " << color( cg.color( QPalette::ToolTipBase ) ) << endl;
-        t << "  base[NORMAL] = " << color( cg.color( QPalette::ToolTipBase ) ) << endl;
-        t << "  text[NORMAL] = " << color( cg.color( QPalette::ToolTipText ) ) << endl;
-        t << "  fg[NORMAL] = " << color( cg.color( QPalette::ToolTipText ) ) << endl;
-        t << "}" << endl;
-        t << endl;
-        t << "widget \"gtk-tooltip\" style \"ToolTip\"" << endl;
-        t << "widget \"gtk-tooltips\" style \"ToolTip\"" << endl;
-        t << "widget \"gtk-tooltip*\" style \"ToolTip\"" << endl;
-        t << endl;
-
-
-        // highlight the current (mouse-hovered) menu-item
-        // not every button, checkbox, etc.
-        t << "style \"MenuItem\"" << endl;
-        t << "{" << endl;
-        t << "  bg[PRELIGHT] = " << color( cg.color(QPalette::Highlight) ) << endl;
-        t << "  fg[PRELIGHT] = " << color( cg.color(QPalette::HighlightedText) ) << endl;
-        t << "}" << endl;
-        t << endl;
-        t << "class \"*MenuItem\" style \"MenuItem\"" << endl;
-        t << endl;
-    }
     saveFile.commit();
 }
 
@@ -692,8 +632,8 @@ void runRdb( uint flags )
   else
     gtkTheme = QStringLiteral("oxygen");
 
-  createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 1 );
-  createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 2 );
+  createGtkrc( newPal, exportGtkTheme, gtkTheme, 1 );
+  createGtkrc( newPal, exportGtkTheme, gtkTheme, 2 );
 
   // Export colors to non-(KDE/Qt) apps (e.g. Motif, GTK+ apps)
   if (exportColors)
-- 
2.25.1

openSUSE Build Service is sponsored by