Bug 143606 - selected text background color uses system background color, but own text color
Summary: selected text background color uses system background color, but own text color
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-29 22:35 UTC by Joseph Tate
Modified: 2010-02-15 17:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of the issue. (115.07 KB, image/png)
2007-03-29 22:38 UTC, Joseph Tate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Tate 2007-03-29 22:35:09 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Unlisted Binary Package
Compiler:          GCC G++ 3.4.4 
OS:                Linux

I have a lighter color set as my "selected background" in kcontrol, with black as the "Selected Text" color.  However in kate, and any application that embeds it, white is used as the selected text color for "normal text".  This makes it very difficult to see that text.  If you're going to dictate the text colors, dictate the select background color too.  The "current line" color appears to be a system color too.
Comment 1 Joseph Tate 2007-03-29 22:38:42 UTC
Created attachment 20127 [details]
Screenshot of the issue.

Here's a screenshot of the selected text issue described above.
Comment 2 Matthew Woehlke 2007-03-30 23:41:17 UTC
I'll confirm this because I know I've seen what Joseph is talking about. This should be an easy fix (if it isn't fixed in trunk already - if so, someone that knows it is can please close this :-)); don't use the system colors for the default background(s).

Meanwhile, Joseph, I trust you've discovered how to change the colors?
Comment 3 Chris Gadd 2007-04-26 10:31:49 UTC
Hi, I've got the inverse problem. Using a high contrast colour scheme (light grey text on dark blue background), Kate uses (for normal unselected text) my system background but doesn't use the system text colour. So I'm left with black text on a dark blue background (not easy to read). Should this be logged as its own bug?
Comment 4 Matthew Woehlke 2007-04-27 17:50:52 UTC
> Should this be logged as its own bug?

No, it's the same issue.
Comment 5 Matthew Woehlke 2007-06-26 02:29:20 UTC
SVN commit 680364 by mwoehlke:

CCBUG: 143606
Fix deprecation warnings (use KColorScheme), also use only colors from the system palette for defaults. This might fix one of the reports in bug 143606 but since changing the system color palette is completely broken right now, I can't check.

TODO: something similar, for default attributes (which should complete the fixing of the bug).


 M  +13 -8     kateconfig.cpp  
 M  +21 -13    kateschema.cpp  
 M  +2 -2      katestyletreewidget.cpp  


--- trunk/KDE/kdelibs/kate/utils/kateconfig.cpp #680363:680364
@@ -28,6 +28,7 @@
 
 #include <kconfig.h>
 #include <kglobalsettings.h>
+#include <kcolorscheme.h>
 #include <kcharsets.h>
 #include <klocale.h>
 #include <kfinddialog.h>
@@ -1146,14 +1147,18 @@
 
   KConfigGroup config = KateGlobal::self()->schemaManager()->schema(KateGlobal::self()->schemaManager()->number(schema));
 
-  QColor tmp0 (KGlobalSettings::baseColor());
-  QColor tmp1 (KGlobalSettings::highlightColor());
-  QColor tmp2 (KGlobalSettings::alternateBackgroundColor());
-  QColor tmp3 ( "#FFFF99" );
-  QColor tmp4 (tmp2.dark());
-  QColor tmp5 ( KGlobalSettings::inactiveTextColor().lighter(50) );
-  QColor tmp6 ( "#EAE9E8" );
-  QColor tmp7 ( "#000000" );
+  // NOTE keep in sync with KateSchemaConfigColorTab::schemaChanged
+  KColorScheme schemeView(KColorScheme::View);
+  KColorScheme schemeWindow(KColorScheme::Window);
+  KColorScheme schemeSelection(KColorScheme::Selection);
+  QColor tmp0( schemeView.background().color() );
+  QColor tmp1( schemeSelection.background().color() );
+  QColor tmp2( schemeView.background(KColorScheme::AlternateBackground).color() );
+  QColor tmp3( schemeView.shade(KColorScheme::LightShade) );
+  QColor tmp4( schemeView.shade(KColorScheme::MidShade) );
+  QColor tmp5( schemeView.shade(KColorScheme::MidlightShade) );
+  QColor tmp6( schemeWindow.background().color() );
+  QColor tmp7( schemeWindow.foreground().color() );
 
   m_backgroundColor = config.readEntry("Color Background", tmp0);
   m_backgroundColorSet = true;
--- trunk/KDE/kdelibs/kate/utils/kateschema.cpp #680363:680364
@@ -31,6 +31,7 @@
 
 #include "ui_schemaconfigcolortab.h"
 
+#include <kcolorscheme.h>
 #include <klocale.h>
 #include <kdialog.h>
 #include <kcolorbutton.h>
@@ -122,7 +123,7 @@
 
 void KateSchemaManager::addSchema (const QString &t)
 {
-  m_config.group(t).writeEntry("Color Background", KGlobalSettings::baseColor());
+  m_config.group(t).writeEntry("Color Background", KColorScheme(KColorScheme::View).background().color());
 
   update (false);
 }
@@ -257,14 +258,18 @@
   if ( ! m_schemas.contains( newSchema ) )
   {
     // fallback defaults
-    QColor tmp0 (KGlobalSettings::baseColor());
-    QColor tmp1 (KGlobalSettings::highlightColor());
-    QColor tmp2 (KGlobalSettings::alternateBackgroundColor());
-    QColor tmp3 ( "#FFFF99" );
-    QColor tmp4 (tmp2.dark());
-    QColor tmp5 ( KGlobalSettings::inactiveTextColor().lighter(50) );
-    QColor tmp6 ( "#EAE9E8" );
-    QColor tmp7 ( "#000000" );
+    // NOTE keep in sync with KateRendererConfig::setSchemaInternal
+    KColorScheme schemeView(KColorScheme::View);
+    KColorScheme schemeWindow(KColorScheme::Window);
+    KColorScheme schemeSelection(KColorScheme::Selection);
+    QColor tmp0( schemeView.background().color() );
+    QColor tmp1( schemeSelection.background().color() );
+    QColor tmp2( schemeView.background(KColorScheme::AlternateBackground).color() );
+    QColor tmp3( schemeView.shade(KColorScheme::LightShade) );
+    QColor tmp4( schemeView.shade(KColorScheme::MidShade) );
+    QColor tmp5( schemeView.shade(KColorScheme::MidlightShade) );
+    QColor tmp6( schemeWindow.background().color() );
+    QColor tmp7( schemeWindow.foreground().color() );
 
     // same std colors like in KateDocument::markColor
     QVector <QColor> mark(KTextEditor::MarkInterface::reservedMarkersCount());
@@ -339,6 +344,9 @@
     kDebug(13030)<<"Using config group "<<config.group()<<endl;
     SchemaColors c = it.value();
 
+    // TODO - don't save if using defaults, so that changing the color scheme
+    // lets colors track the new scheme if they haven't been customized
+    // Although, KColorScheme should handle this eventually...
     config.writeEntry("Color Background", c.back);
     config.writeEntry("Color Selection", c.selected);
     config.writeEntry("Color Highlighted Line", c.current);
@@ -485,11 +493,11 @@
 
   // set colors
   QPalette p ( m_defaultStyles->palette() );
-  QColor _c ( KGlobalSettings::baseColor() );
+  QColor _c ( KColorScheme(KColorScheme::View).background().color() );
   p.setColor( QPalette::Base,
     KateGlobal::self()->schemaManager()->schema(schema).
       readEntry( "Color Background", _c ) );
-  _c = KGlobalSettings::highlightColor();
+  _c = KColorScheme(KColorScheme::Selection).background().color();
   p.setColor( QPalette::Highlight,
     KateGlobal::self()->schemaManager()->schema(schema).
       readEntry( "Color Selection", _c ) );
@@ -613,11 +621,11 @@
   // TODO this reads of the KConfig object, which should be changed when
   // the color tab is fixed.
   QPalette p ( m_styles->palette() );
-  QColor _c ( KGlobalSettings::baseColor() );
+  QColor _c ( KColorScheme(KColorScheme::View).background().color() );
   p.setColor( QPalette::Base,
     KateGlobal::self()->schemaManager()->schema(m_schema).
       readEntry( "Color Background", _c ) );
-  _c = KGlobalSettings::highlightColor();
+  _c = KColorScheme(KColorScheme::Selection).background().color();
   p.setColor( QPalette::Highlight,
     KateGlobal::self()->schemaManager()->schema(m_schema).
       readEntry( "Color Selection", _c ) );
--- trunk/KDE/kdelibs/kate/utils/katestyletreewidget.cpp #680363:680364
@@ -27,7 +27,7 @@
 
 #include <klocale.h>
 #include <kicon.h>
-#include <kglobalsettings.h>
+#include <kcolorscheme.h>
 #include <kmenu.h>
 #include <kmessagebox.h>
 #include <kcolordialog.h>
@@ -137,7 +137,7 @@
   headerItem()->setIcon(4, KIcon("format-text-strikethrough"));
 
   // grap the bg color, selected color and default font
-  normalcol = KGlobalSettings::textColor();
+  normalcol = KColorScheme(KColorScheme::View).foreground().color();
   bgcol = KateRendererConfig::global()->backgroundColor();
   selcol = KateRendererConfig::global()->selectionColor();
   docfont = KateRendererConfig::global()->font();
Comment 6 Joseph Wenninger 2010-02-15 17:26:31 UTC
I think this is fixed in KDE 4.x