]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/ColorCache.cpp
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / ColorCache.cpp
index 66b10c1df97cc2bf625acc0565946e116152a866..9c5adb4f65e316b014c9b7905a262dc3e620bf27 100644 (file)
@@ -48,6 +48,9 @@ QPalette::ColorRole role(ColorCode col)
        case Color_selectiontext:
                return QPalette::HighlightedText;
                break;
+       case Color_urllabel:
+       case Color_urltext:
+               return QPalette::Link;
        default:
                return NoRole;
        }
@@ -79,10 +82,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 +110,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;
 }