From: Jean-Marc Lasgouttes Date: Mon, 6 Sep 2010 13:02:18 +0000 (+0000) Subject: When the non-system background is used, let it be editable too. X-Git-Tag: 2.0.0~2678 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=58c9d2ed61991c17cfaeb2e10a630aa86adb5b03;p=lyx.git When the non-system background is used, let it be editable too. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35297 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/ColorCache.cpp b/src/frontends/qt4/ColorCache.cpp index 66b10c1df9..32b602c2eb 100644 --- a/src/frontends/qt4/ColorCache.cpp +++ b/src/frontends/qt4/ColorCache.cpp @@ -79,10 +79,10 @@ QColor ColorCache::get(Color const & color, bool syscolors) const if (!initialized_) const_cast(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; }