A never ending story.

Michael Reiher michael.reiher at gmx.de
Sun Sep 22 23:55:13 BST 2002


Hi!

Short version:

I know I might perhaps be annoying, but those problems with inverted widget
colors and sane defaults, where colors are not explicitly set, still persist.
Dirk made some changes which fixed a few cases but others still remained. I
made a patch now from which I think it solves the problem at the root and in a
more general way. I can only say that it works perfectly for me and fixes all
my test cases.

Patch attached.

Longer version:

It basically reads a complete separate color scheme from config(further refered
to as "HTML Colors") and uses it for the view. I.e. this includes _all_ widget
and link colors. IMHO it doesn't make sence to try to fix that intelligently,
e.g. to only use a custom backgound default(white) when the text color is
explicitly set, but not if none of both is set. Then perhaps the link color is
specified and thus unreadable or what ever. Here only helps the sledgehammer,
create a default environment as the webdesigners expect it. The defaults are
the current application palette colors, so there shouldn't be any difference if
there are no HTML Colors specified. The user could now simply select another
color scheme(which fits with it's widget colors) for all KHTML stuff or we
could extend current schemes to contain the HTML colors as well. The
configuration is another topic however. 

Of course I'm not very much into khtml so I don't know if there is a better way
to do this. In particular I don't like the code duplication for creating the
palette in khtml_settings.cc and  helper.cpp. But I didn't see an easy to
access KHTMLSettings from helper.cpp or the other way round. 

One question which remains is: should there be a bool setting to
programmatically enable/disable the use of HTML colors. I could for instance
imagine that e.g. KNode or KMail when viewing pure text mails would want to use
standard KDE colors. At least I would expect that(I think).

Detailed changes:

khtml_settings.cc
 - removed separated, unused properties linkcolor, visitedLinkColor,
foreground. 
   (Erm, what just comes to my mind: Are those functions available to outside?
Then they should probably be readded again, and same for the member vars)
 - added complete palette with HTML colors, read from section [HTML Colors],
defaulting current application palette (code taken from KApplication)

khtml_part.cpp
 - use the HTML Colors palette for the views viewport window(and consequently
for it's children)

html_formimpl.cpp
 - use same color for checkboxes,radiobuttons as in the rest of KDE

helper.cpp
 - set colors in the color table to HTML Colors. I changed a bit more, see
below.

   (btw, this whole colors setting seemes quite strange and wrong to me. It
reads all colors from group "WM" where it should be "General". Some colors are
read from config files, others are taken from the application palette. The
colors read from the config file are the same as the application palette
anyway, i.e. it's useless to read them at all. The assingment from color name
to color seems also wrong, e.g. texts are assigned QColorGroup::Background(see
my comments).)

render_html.cpp
 - use viewports palette(HTML Colors), as the views palette is the KDE palette

Comments please?

Greets

Michael
-------------- next part --------------
? colorfix.diff
Index: khtml_part.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
retrieving revision 1.743
diff -b -u -p -r1.743 khtml_part.cpp
--- khtml_part.cpp	2002/09/06 21:31:13	1.743
+++ khtml_part.cpp	2002/09/22 22:52:06
@@ -164,6 +164,7 @@ void KHTMLPart::init( KHTMLView *view, G
 
   d->m_view = view;
   setWidget( d->m_view );
+  d->m_view->viewport()->setPalette( d->m_settings->htmlPalette() );
 
   d->m_guiProfile = prof;
   d->m_extension = new KHTMLPartBrowserExtension( this );
Index: khtml_settings.cc
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_settings.cc,v
retrieving revision 1.88
diff -b -u -p -r1.88 khtml_settings.cc
--- khtml_settings.cc	2002/07/19 19:06:14	1.88
+++ khtml_settings.cc	2002/09/22 22:52:07
@@ -19,6 +19,7 @@
 
 #include <qfontdatabase.h>
 #include <qregexp.h>
+#include <qpalette.h>
 
 #include "khtml_settings.h"
 #include "khtmldefaults.h"
@@ -26,6 +27,7 @@
 #include <kconfig.h>
 #include <kglobal.h>
 #include <klocale.h>
+#include <kapplication.h>
 #include <kdebug.h>
 #include <qregexp.h>
 
@@ -55,9 +57,7 @@ public:
     QString m_encoding;
     QString m_userSheet;
 
-    QColor m_textColor;
-    QColor m_linkColor;
-    QColor m_vLinkColor;
+    QPalette m_htmlPalette;
 
     QMap<QString,KHTMLSettings::KJavaScriptAdvice> javaDomainPolicy;
     QMap<QString,KHTMLSettings::KJavaScriptAdvice> javaScriptDomainPolicy;
@@ -245,21 +245,89 @@ void KHTMLSettings::init( KConfig * conf
     d->m_maxFormCompletionItems = config->readNumEntry("MaxFormCompletionItems", 10);
   }
 
-  // Colors
-  if ( reset || config->hasGroup( "General" ) )
+  // Local HTML palette ( code taken from KApplication )
+  if ( reset || config->hasGroup( "HTML Colors" ) )
   {
-    config->setGroup( "General" ); // group will be restored by cgs anyway
-    if ( reset || config->hasKey( "foreground" ) )
-      d->m_textColor = config->readColorEntry( "foreground", &HTML_DEFAULT_TXT_COLOR );
+    config->setGroup( "HTML Colors" );
 
-    if ( reset || config->hasKey( "linkColor" ) )
-      d->m_linkColor = config->readColorEntry( "linkColor", &HTML_DEFAULT_LNK_COLOR );
+    int contrast_ = KGlobalSettings::contrast();
+    const QPalette &defaultPal = kapp->palette();
 
-    if ( reset || config->hasKey( "visitedLinkColor" ) )
-      d->m_vLinkColor = config->readColorEntry( "visitedLinkColor", &HTML_DEFAULT_VLNK_COLOR);
-  }
+    QColor background = config->readColorEntry( "background", &defaultPal.active().background() );
+    QColor foreground = config->readColorEntry( "foreground", &defaultPal.active().foreground() );
+    QColor button = config->readColorEntry( "buttonBackground", &background );
+    QColor buttonText = config->readColorEntry( "buttonForeground", &foreground );
+    QColor highlight = config->readColorEntry( "selectBackground", &defaultPal.active().highlight() );
+    QColor highlightedText = config->readColorEntry( "selectForeground", &defaultPal.active().highlightedText() );
+    QColor base = config->readColorEntry( "windowBackground", &defaultPal.active().base() );
+    QColor baseText = config->readColorEntry( "windowForeground", &defaultPal.active().text() );
+    QColor link = config->readColorEntry( "linkColor", &defaultPal.active().link() );
+    QColor visitedLink = config->readColorEntry( "visitedLinkColor", &defaultPal.active().linkVisited() );
+
+    int highlightVal = 100 + (2*contrast_+4)*16/10;
+    int lowlightVal = 100 + (2*contrast_+4)*10;
+
+    QColor disfg = foreground;
+
+    int h, s, v;
+    disfg.hsv( &h, &s, &v );
+    if (v > 128)
+      // dark bg, light fg - need a darker disabled fg
+      disfg = disfg.dark(lowlightVal);
+    else if (disfg != Qt::black)
+      // light bg, dark fg - need a lighter disabled fg - but only if !black
+      disfg = disfg.light(highlightVal);
+    else
+      // black fg - use darkgrey disabled fg
+      disfg = Qt::darkGray;
 
 
+    QColorGroup disabledgrp(disfg, background,
+                            background.light(highlightVal),
+                            background.dark(lowlightVal),
+                            background.dark(120),
+                            background.dark(120), base);
+
+    QColorGroup colgrp(foreground, background, background.light(highlightVal),
+                       background.dark(lowlightVal),
+                       background.dark(120),
+                       baseText, base);
+
+    int inlowlightVal = lowlightVal-25;
+    if(inlowlightVal < 120)
+      inlowlightVal = 120;
+
+    colgrp.setColor(QColorGroup::Highlight, highlight);
+    colgrp.setColor(QColorGroup::HighlightedText, highlightedText);
+    colgrp.setColor(QColorGroup::Button, button);
+    colgrp.setColor(QColorGroup::ButtonText, buttonText);
+    colgrp.setColor(QColorGroup::Midlight, background.light(110));
+    colgrp.setColor(QColorGroup::Link, link);
+    colgrp.setColor(QColorGroup::LinkVisited, visitedLink);
+
+    disabledgrp.setColor(QColorGroup::Button, button);
+
+    QColor disbtntext = buttonText;
+    disbtntext.hsv( &h, &s, &v );
+    if (v > 128)
+      // dark button, light buttonText - need a darker disabled buttonText
+      disbtntext = disbtntext.dark(lowlightVal);
+    else if (disbtntext != Qt::black)
+      // light buttonText, dark button - need a lighter disabled buttonText - but only if !black
+      disbtntext = disbtntext.light(highlightVal);
+    else
+      // black button - use darkgrey disabled buttonText
+      disbtntext = Qt::darkGray;
+
+    disabledgrp.setColor(QColorGroup::ButtonText, disbtntext);
+    disabledgrp.setColor(QColorGroup::Midlight, background.light(110));
+    disabledgrp.setColor(QColorGroup::Link, link);
+    disabledgrp.setColor(QColorGroup::LinkVisited, visitedLink);
+
+    d->m_htmlPalette = QPalette(colgrp, disabledgrp, colgrp);
+    kdDebug() << "KHTMLSettings::init ###### Palette Base: " << d->m_htmlPalette.active().color(QColorGroup::Base).name() << endl;
+  }
+
   if( reset || config->hasGroup( "Java/JavaScript Settings" ) )
   {
     config->setGroup( "Java/JavaScript Settings" );
@@ -445,7 +513,7 @@ QString KHTMLSettings::settingsToCSS() c
 {
     // lets start with the link properties
     QString str = "a:link {\ncolor: ";
-    str += d->m_linkColor.name();
+    str += d->m_htmlPalette.active().color(QColorGroup::Link).name();
     str += ";";
     if(d->m_underlineLink)
         str += "\ntext-decoration: underline;";
@@ -457,7 +525,7 @@ QString KHTMLSettings::settingsToCSS() c
     }
     str += "\n}\n";
     str += "a:visited {\ncolor: ";
-    str += d->m_vLinkColor.name();
+    str += d->m_htmlPalette.active().color(QColorGroup::LinkVisited).name();
     str += ";";
     if(d->m_underlineLink)
         str += "\ntext-decoration: underline;";
@@ -568,20 +636,10 @@ const QString &KHTMLSettings::encoding()
 {
   return d->m_encoding;
 }
-
-const QColor& KHTMLSettings::textColor() const
-{
-  return d->m_textColor;
-}
-
-const QColor& KHTMLSettings::linkColor() const
-{
-  return d->m_linkColor;
-}
 
-const QColor& KHTMLSettings::vLinkColor() const
+const QPalette& KHTMLSettings::htmlPalette() const
 {
-  return d->m_vLinkColor;
+  return d->m_htmlPalette;
 }
 
 bool KHTMLSettings::autoLoadImages() const
Index: khtml_settings.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_settings.h,v
retrieving revision 1.33
diff -b -u -p -r1.33 khtml_settings.h
--- khtml_settings.h	2002/07/19 19:06:14	1.33
+++ khtml_settings.h	2002/09/22 22:52:07
@@ -97,9 +97,7 @@ public:
     const QString &encoding() const;
 
     // Color settings
-    const QColor& textColor() const;
-    const QColor& linkColor() const;
-    const QColor& vLinkColor() const;
+    const QPalette& htmlPalette() const;
 
     // Autoload images
     bool autoLoadImages() const;
Index: html/html_formimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_formimpl.cpp,v
retrieving revision 1.284
diff -b -u -p -r1.284 html_formimpl.cpp
--- html/html_formimpl.cpp	2002/08/23 13:38:32	1.284
+++ html/html_formimpl.cpp	2002/09/22 22:52:11
@@ -1051,9 +1051,11 @@ void HTMLInputElementImpl::attach()
     case SUBMIT:
     case RESET:
     case BUTTON:
+        addCSSProperty(CSS_PROP_COLOR, "buttontext");
+        break;
     case CHECKBOX:
     case RADIO:
-        addCSSProperty(CSS_PROP_COLOR, "buttontext" );
+        addCSSProperty(CSS_PROP_COLOR, "text" );
     case HIDDEN:
     case IMAGE:
         if (!getAttribute(ATTR_WIDTH).isNull())
Index: misc/helper.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/misc/helper.cpp,v
retrieving revision 1.45
diff -b -u -p -r1.45 helper.cpp
--- misc/helper.cpp	2002/05/09 23:27:42	1.45
+++ misc/helper.cpp	2002/09/22 22:52:12
@@ -30,6 +30,8 @@
 #include <kstaticdeleter.h>
 #include <kapplication.h>
 #include <kconfig.h>
+#include <kglobalsettings.h>
+#include <kdebug.h>
 #include <qtooltip.h>
 
 using namespace DOM;
@@ -69,83 +71,164 @@ static const colorMap cmap[] = {
 
 struct uiColors {
     const char * name;
-    const char * configGroup;
-    const char * configEntry;
     const QPalette::ColorGroup group;
     const QColorGroup::ColorRole role;
 };
 
-const char * const wmgroup = "WM";
-const char * const generalgroup = "General";
-
 static const uiColors uimap[] = {
 	// Active window border.
-    { "activeborder", wmgroup, "background", QPalette::Active, QColorGroup::Light },
+    { "activeborder", QPalette::Active, QColorGroup::Light },
 	// Active window caption.
-    { "activecaption", wmgroup, "background", QPalette::Active, QColorGroup::Text },
+    { "activecaption", QPalette::Active, QColorGroup::Text },
         // Text in caption, size box, and scrollbar arrow box.
-    { "captiontext", wmgroup, "activeForeground", QPalette::Active, QColorGroup::Text },
+    { "captiontext", QPalette::Active, QColorGroup::Text },
 	// Face color for three-dimensional display elements.
-    { "buttonface", wmgroup, 0, QPalette::Inactive, QColorGroup::Button },
+    { "buttonface", QPalette::Inactive, QColorGroup::Button }, // MR: shouldn't this be QColorGroup::ButtonText
 	// Dark shadow for three-dimensional display elements (for edges facing away from the light source).
-    { "buttonhighlight", wmgroup, 0, QPalette::Inactive, QColorGroup::Light },
+    { "buttonhighlight", QPalette::Inactive, QColorGroup::Light },
 	// Shadow color for three-dimensional display elements.
-    { "buttonshadow", wmgroup, 0, QPalette::Inactive, QColorGroup::Shadow },
+    { "buttonshadow", QPalette::Inactive, QColorGroup::Shadow },
 	// Text on push buttons.
-    { "buttontext", wmgroup, "buttonForeground", QPalette::Inactive, QColorGroup::ButtonText },
+    { "buttontext", QPalette::Inactive, QColorGroup::ButtonText },
 	// Dark shadow for three-dimensional display elements.
-    { "threeddarkshadow", wmgroup, 0, QPalette::Inactive, QColorGroup::Dark },
+    { "threeddarkshadow", QPalette::Inactive, QColorGroup::Dark },
 	// Face color for three-dimensional display elements.
-    { "threedface", wmgroup, 0, QPalette::Inactive, QColorGroup::Button },
+    { "threedface", QPalette::Inactive, QColorGroup::Button }, // MR: shouldn't this be QColorGroup::ButtonText
 	// Highlight color for three-dimensional display elements.
-    { "threedhighlight", wmgroup, 0, QPalette::Inactive, QColorGroup::Light },
+    { "threedhighlight", QPalette::Inactive, QColorGroup::Light },
 	// Light color for three-dimensional display elements (for edges facing the light source).
-    { "threedlightshadow", wmgroup, 0, QPalette::Inactive, QColorGroup::Midlight },
+    { "threedlightshadow", QPalette::Inactive, QColorGroup::Midlight },
 	// Dark shadow for three-dimensional display elements.
-    { "threedshadow", wmgroup, 0, QPalette::Inactive, QColorGroup::Shadow },
+    { "threedshadow", QPalette::Inactive, QColorGroup::Shadow },
 
     // Inactive window border.
-    { "inactiveborder", wmgroup, "background", QPalette::Disabled, QColorGroup::Background },
+    { "inactiveborder", QPalette::Disabled, QColorGroup::Background },
     // Inactive window caption.
-    { "inactivecaption", wmgroup, "inactiveBackground", QPalette::Disabled, QColorGroup::Background },
+    { "inactivecaption", QPalette::Disabled, QColorGroup::Background },
     // Color of text in an inactive caption.
-    { "inactivecaptiontext", wmgroup, "inactiveForeground", QPalette::Disabled, QColorGroup::Text },
-    { "graytext", wmgroup, 0, QPalette::Disabled, QColorGroup::Text },
+    { "inactivecaptiontext", QPalette::Disabled, QColorGroup::Text },
+    { "graytext", QPalette::Disabled, QColorGroup::Text },
 
 	// Menu background
-    { "menu", generalgroup, "background", QPalette::Inactive, QColorGroup::Background },
+    { "menu", QPalette::Inactive, QColorGroup::Background },
 	// Text in menus
-    { "menutext", generalgroup, "foreground", QPalette::Inactive, QColorGroup::Background },
+    { "menutext", QPalette::Inactive, QColorGroup::Background }, // MR: shouldn't this be QColorGroup::Foreground
 
         // Text of item(s) selected in a control.
-    { "highlight", generalgroup, "selectBackground", QPalette::Inactive, QColorGroup::Background },
+    { "highlight", QPalette::Inactive, QColorGroup::Background }, // MR: shouldn't this be QColorGroup::Highlight
 
     // Text of item(s) selected in a control.
-    { "highlighttext", generalgroup, "selectForeground", QPalette::Inactive, QColorGroup::Background },
+    { "highlighttext", QPalette::Inactive, QColorGroup::Background }, // MR: shouldn't this be QColorGroup::HighlightedText
 
 	// Background color of multiple document interface.
-    { "appworkspace", generalgroup, "background", QPalette::Inactive, QColorGroup::Text },
+    { "appworkspace", QPalette::Inactive, QColorGroup::Text }, // MR: shouldn't this be QColorGroup::Base
 
 	// Scroll bar gray area.
-    { "scrollbar", generalgroup, "background", QPalette::Inactive, QColorGroup::Background },
+    { "scrollbar", QPalette::Inactive, QColorGroup::Background },
 
 	// Window background.
-    { "window", generalgroup, "windowBackground", QPalette::Inactive, QColorGroup::Background },
+    { "window", QPalette::Inactive, QColorGroup::Background },
 	// Window frame.
-    { "windowframe", generalgroup, "windowBackground", QPalette::Inactive, QColorGroup::Background },
+    { "windowframe", QPalette::Inactive, QColorGroup::Background },
         // WindowText
-    { "windowtext", generalgroup, "windowForeground", QPalette::Inactive, QColorGroup::Text },
-    { "text", generalgroup, 0, QPalette::Inactive, QColorGroup::Text },
-    { 0, 0, 0, QPalette::NColorGroups, QColorGroup::NColorRoles }
+    { "windowtext", QPalette::Inactive, QColorGroup::Text }, // MR: shouldn't this be QColorGroup::Foreground
+    { "text", QPalette::Inactive, QColorGroup::Text },
+    { 0, QPalette::NColorGroups, QColorGroup::NColorRoles }
 };
 
 HTMLColors::HTMLColors()
 {
+  // Local HTML palette ( code taken from KApplication )
+  KConfig *config = KGlobal::config();
+  QString lastConfigGroup = config->group();
+  config->setGroup( "HTML Colors" );
+
+  int contrast_ = KGlobalSettings::contrast();
+  const QPalette &defaultPal = kapp->palette();
+
+  QColor background = config->readColorEntry( "background", &defaultPal.active().background() );
+  QColor foreground = config->readColorEntry( "foreground", &defaultPal.active().foreground() );
+  QColor button = config->readColorEntry( "buttonBackground", &background );
+  QColor buttonText = config->readColorEntry( "buttonForeground", &foreground );
+  QColor highlight = config->readColorEntry( "selectBackground", &defaultPal.active().highlight() );
+  QColor highlightedText = config->readColorEntry( "selectForeground", &defaultPal.active().highlightedText() );
+  QColor base = config->readColorEntry( "windowBackground", &defaultPal.active().base() );
+  QColor baseText = config->readColorEntry( "windowForeground", &defaultPal.active().text() );
+  QColor link = config->readColorEntry( "linkColor", &defaultPal.active().link() );
+  QColor visitedLink = config->readColorEntry( "visitedLinkColor", &defaultPal.active().linkVisited() );
+
+  int highlightVal = 100 + (2*contrast_+4)*16/10;
+  int lowlightVal = 100 + (2*contrast_+4)*10;
+
+  QColor disfg = foreground;
+
+  int h, s, v;
+  disfg.hsv( &h, &s, &v );
+  if (v > 128)
+    // dark bg, light fg - need a darker disabled fg
+    disfg = disfg.dark(lowlightVal);
+  else if (disfg != Qt::black)
+    // light bg, dark fg - need a lighter disabled fg - but only if !black
+    disfg = disfg.light(highlightVal);
+  else
+    // black fg - use darkgrey disabled fg
+    disfg = Qt::darkGray;
+
+
+  QColorGroup disabledgrp(disfg, background,
+                          background.light(highlightVal),
+                          background.dark(lowlightVal),
+                          background.dark(120),
+                          background.dark(120), base);
+
+  QColorGroup colgrp(foreground, background, background.light(highlightVal),
+                     background.dark(lowlightVal),
+                     background.dark(120),
+                     baseText, base);
+
+  int inlowlightVal = lowlightVal-25;
+  if(inlowlightVal < 120)
+    inlowlightVal = 120;
+
+  colgrp.setColor(QColorGroup::Highlight, highlight);
+  colgrp.setColor(QColorGroup::HighlightedText, highlightedText);
+  colgrp.setColor(QColorGroup::Button, button);
+  colgrp.setColor(QColorGroup::ButtonText, buttonText);
+  colgrp.setColor(QColorGroup::Midlight, background.light(110));
+  colgrp.setColor(QColorGroup::Link, link);
+  colgrp.setColor(QColorGroup::LinkVisited, visitedLink);
+
+  disabledgrp.setColor(QColorGroup::Button, button);
+
+  QColor disbtntext = buttonText;
+  disbtntext.hsv( &h, &s, &v );
+  if (v > 128)
+    // dark button, light buttonText - need a darker disabled buttonText
+    disbtntext = disbtntext.dark(lowlightVal);
+  else if (disbtntext != Qt::black)
+    // light buttonText, dark button - need a lighter disabled buttonText - but only if !black
+    disbtntext = disbtntext.light(highlightVal);
+  else
+    // black button - use darkgrey disabled buttonText
+    disbtntext = Qt::darkGray;
+
+  disabledgrp.setColor(QColorGroup::ButtonText, disbtntext);
+  disabledgrp.setColor(QColorGroup::Midlight, background.light(110));
+  disabledgrp.setColor(QColorGroup::Link, link);
+  disabledgrp.setColor(QColorGroup::LinkVisited, visitedLink);
+
+  QPalette htmlPal(colgrp, disabledgrp, colgrp);
+  kdDebug() << "HTMLColors::HTMLColors ###### Palette Base: " << htmlPal.active().color(QColorGroup::Base).name() << endl;
+
+  config->setGroup( lastConfigGroup );
+
+
     const colorMap *color = cmap;
     while ( color->name ) {
 	map[color->name] = color->value;
 	++color;
     }
+
     // ### react to style changes
     // see http://www.richinstyle.com for details
 
@@ -153,19 +236,9 @@ HTMLColors::HTMLColors()
      * Tried hard to get an appropriate mapping - schlpbch
      */
 
-    KConfig *globalConfig = KGlobal::config();
-    const QPalette &pal = kapp->palette();
-
     const uiColors *uicol = uimap;
-    const char *lastConfigGroup = 0;
     while( uicol->name ) {
-	if ( lastConfigGroup != uicol->configGroup ) {
-	    lastConfigGroup = uicol->configGroup;
-	    globalConfig->setGroup( lastConfigGroup );
-	}
-	QColor c = pal.color( uicol->group, uicol->role );
-	if ( uicol->configEntry )
-	    c = globalConfig->readColorEntry( uicol->configEntry, &c );
+    QColor c = htmlPal.color( uicol->group, uicol->role );
 	map[uicol->name] = c;
 	++uicol;
     }
@@ -180,7 +253,7 @@ HTMLColors::HTMLColors()
     KConfig bckgrConfig("kdesktoprc", true, false); // No multi-screen support
     bckgrConfig.setGroup("Desktop0");
         // Desktop background.
-    map["background"] = bckgrConfig.readColorEntry("Color1", &pal.disabled().background());
+  map["background"] = bckgrConfig.readColorEntry("Color1", &htmlPal.disabled().background());
 };
 
 
Index: rendering/render_html.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_html.cpp,v
retrieving revision 1.24
diff -b -u -p -r1.24 render_html.cpp
--- rendering/render_html.cpp	2002/01/14 19:56:45	1.24
+++ rendering/render_html.cpp	2002/09/22 22:52:12
@@ -26,6 +26,9 @@
 
 #include "khtmlview.h"
 
+#include <kglobal.h>
+#include <kapplication.h>
+#include <kconfig.h>
 #include <kdebug.h>
 
 using namespace khtml;
@@ -68,7 +71,7 @@ void RenderHtml::printBoxDecorations(QPa
 	if( !bg )
 	    bg = firstChild()->style()->backgroundImage();
         if( !c.isValid() && root()->view())
-            c = root()->view()->palette().active().color(QColorGroup::Base);
+        c = root()->view()->viewport()->palette().active().color(QColorGroup::Base);
     }
 
     int w = width();


More information about the kfm-devel mailing list