]> git.lyx.org Git - features.git/commitdiff
Do not overwrite background color with system background color if this color is white
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 Sep 2010 10:26:58 +0000 (10:26 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 Sep 2010 10:26:58 +0000 (10:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35295 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/ColorCache.cpp

index 5b0e56d32a4ad414b512317e6a62ac0b854cc633..66b10c1df97cc2bf625acc0565946e116152a866 100644 (file)
@@ -80,9 +80,14 @@ QColor ColorCache::get(Color const & color, bool syscolors) const
                const_cast<ColorCache *>(this)->init();
        if (color <= Color_ignore && color.mergeColor == Color_ignore) {
                QPalette::ColorRole cr = role(color.baseColor);
-               if (syscolors && cr != NoRole) 
-                       return pal_.brush(QPalette::Active, cr).color();
-               else
+               if (syscolors && cr != NoRole) {
+                       static QColor white = Qt::white;
+                       QColor c = pal_.brush(QPalette::Active, cr).color();
+                       if (cr == QPalette::Base && c == white)
+                               return lcolors_[color.baseColor];
+                       else
+                               return c;
+               } else
                        return lcolors_[color.baseColor];
        }
        if (color.mergeColor != Color_ignore) {