]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/lcolorcache.C
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / lcolorcache.C
index fb7772bb33599b2571fd3aec3f62ec4d65abc6c5..eeb1102925ab7a798b2b355c13261e0e537e1f1e 100644 (file)
 
 #include <config.h>
 
+#include "Color.h"
 #include "lcolorcache.h"
 
 #include "LColor.h"
 
 LColorCache lcolorcache;
 
+const QColor grey40(0x66, 0x66, 0x66);
+const QColor grey60(0x99, 0x99, 0x99);
+const QColor grey80(0xcc, 0xcc, 0xcc);
+const QColor grey90(0xe5, 0xe5, 0xe5);
+const QColor none = Qt::black;
+
 
 LColorCache::LColorCache()
 {
 }
 
-
 QColor const & LColorCache::get(LColor_color col) const
 {
        lcolor_map::const_iterator cit = colormap.find(col);
@@ -29,13 +35,15 @@ QColor const & LColorCache::get(LColor_color col) const
                return cit->second;
 
        if (lcolor.getX11Name(col) == "grey40")
-               colormap[col] = Qt::lightGray;
+               colormap[col] = grey40;
        else if (lcolor.getX11Name(col) == "grey60")
-               colormap[col] = Qt::gray;
+               colormap[col] = grey60;
        else if (lcolor.getX11Name(col) == "grey80")
-               colormap[col] = Qt::darkGray;
+               colormap[col] = grey80;
        else if (lcolor.getX11Name(col) == "grey90")
-               colormap[col] = Qt::darkGray;
+               colormap[col] = grey90;
+       else if (lcolor.getX11Name(col) == "none")
+               colormap[col] = none;
        else
                colormap[col] = QColor(lcolor.getX11Name(col).c_str());
 
@@ -47,3 +55,9 @@ void LColorCache::clear()
 {
        colormap.clear();
 }
+
+
+QColor const rgb2qcolor(lyx::RGBColor const & rgb)
+{
+       return QColor(rgb.r, rgb.g, rgb.b);
+}