]> Dogcows Code - chaz/openbox/blobdiff - src/Font.cc
Ignore dot files in the styles directory.
[chaz/openbox] / src / Font.cc
index ea70933acffbb1630841784d799b552de7788b02..4699350c2d22f90af0e30e349993c944479596d0 100644 (file)
@@ -49,7 +49,7 @@ string      BFont::_fallback_font   = "fixed";
 #ifdef XFT
 BFont::BFont(Display *d, BScreen *screen, const string &family, int size,
              bool bold, bool italic, bool shadow, unsigned char offset, 
-             unsigned char tint, bool antialias) :
+             int tint, bool antialias) :
                                           _display(d),
                                           _screen(screen),
                                           _family(family),
@@ -265,14 +265,22 @@ void BFont::drawString(Drawable d, int x, int y, const BColor &color,
                                   _screen->getColormap());
     assert(draw);
 
+
     if (_shadow) {
       XftColor c;
-      c.color.red = 0;
-      c.color.green = 0;
-      c.color.blue = 0;
-      c.color.alpha = _tint | _tint << 8; // transparent shadow
-      c.pixel = BlackPixel(_display, _screen->getScreenNumber());
-
+      if (_tint >= 0) {
+        c.color.red = 0;
+        c.color.green =  0;
+        c.color.blue = 0;
+        c.color.alpha = 0xffff * _tint/100; // transparent shadow
+        c.pixel = BlackPixel(_display, _screen->getScreenNumber());
+      } else {
+        c.color.red = 0xffff * -_tint/100;
+        c.color.green = 0xffff * -_tint/100;
+        c.color.blue = 0xffff * -_tint/100;
+        c.color.alpha = 0xffff * -_tint/100;
+        c.pixel = WhitePixel(_display, _screen->getScreenNumber());
+      }
 #ifdef XFT_UTF8
       XftDrawStringUtf8(
 #else
This page took 0.022991 seconds and 4 git commands to generate.