]> git.lyx.org Git - lyx.git/commitdiff
When the non-system background is used, let it be editable too.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 Sep 2010 13:02:18 +0000 (13:02 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 Sep 2010 13:02:18 +0000 (13:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35297 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/ColorCache.cpp

index 66b10c1df97cc2bf625acc0565946e116152a866..32b602c2ebbdde458562d1a3fa74f19b07d03981 100644 (file)
@@ -79,10 +79,10 @@ QColor ColorCache::get(Color const & color, bool syscolors) const
        if (!initialized_)
                const_cast<ColorCache *>(this)->init();
        if (color <= Color_ignore && color.mergeColor == Color_ignore) {
-               QPalette::ColorRole cr = role(color.baseColor);
+               QPalette::ColorRole const cr = role(color.baseColor);
                if (syscolors && cr != NoRole) {
-                       static QColor white = Qt::white;
-                       QColor c = pal_.brush(QPalette::Active, cr).color();
+                       static QColor const white = Qt::white;
+                       QColor const c = pal_.brush(QPalette::Active, cr).color();
                        if (cr == QPalette::Base && c == white)
                                return lcolors_[color.baseColor];
                        else
@@ -107,7 +107,12 @@ QColor ColorCache::get(Color const & color, bool syscolors) const
 
 bool ColorCache::isSystem(ColorCode const color) const
 {
-       return role(color) != NoRole;
+       QPalette::ColorRole const cr = role(color);
+       if (cr == QPalette::Base) {
+               static QColor const white = Qt::white;
+               return pal_.brush(QPalette::Active, cr).color() != white;
+       } else
+               return cr != NoRole;
 }