]> Dogcows Code - chaz/openbox/blobdiff - src/Texture.cc
Take menu file from rc file if it isn't specified on the command line.
[chaz/openbox] / src / Texture.cc
index caab82e83f2c87f12090da18145e129b3c9e863d..75283a918c7c9113fa6f814274bfd2609fec0e86 100644 (file)
@@ -46,14 +46,14 @@ using std::string;
 BTexture::BTexture(const BaseDisplay * const _display,
                    unsigned int _screen, BImageControl* _ctrl)
   : c(_display, _screen), ct(_display, _screen),
-    lc(_display, _screen), sc(_display, _screen), t(0),
+    lc(_display, _screen), sc(_display, _screen), bc(_display, _screen), t(0),
     dpy(_display), ctrl(_ctrl), scrn(_screen) { }
 
 
 BTexture::BTexture(const string &d, const BaseDisplay * const _display,
                    unsigned int _screen, BImageControl* _ctrl)
   : c(_display, _screen), ct(_display, _screen),
-    lc(_display, _screen), sc(_display, _screen), t(0),
+    lc(_display, _screen), sc(_display, _screen), bc(_display, _screen), t(0),
     dpy(_display), ctrl(_ctrl), scrn(_screen) {
   setDescription(d);
 }
@@ -116,8 +116,6 @@ void BTexture::setDescription(const string &d) {
         addTexture(BTexture::PipeCross);
       else if (descr.find("elliptic") != string::npos)
         addTexture(BTexture::Elliptic);
-      else if (descr.find("diagonal") != string::npos)
-        addTexture(BTexture::Diagonal);
       else if (descr.find("horizontal") != string::npos)
         addTexture(BTexture::Horizontal);
       else if (descr.find("vertical") != string::npos)
@@ -128,16 +126,17 @@ void BTexture::setDescription(const string &d) {
       addTexture(BTexture::Solid);
     }
 
-    if (descr.find("raised") != string::npos)
-      addTexture(BTexture::Raised);
-    else if (descr.find("sunken") != string::npos)
+    if (descr.find("sunken") != string::npos)
       addTexture(BTexture::Sunken);
     else if (descr.find("flat") != string::npos)
       addTexture(BTexture::Flat);
     else
       addTexture(BTexture::Raised);
 
-    if (! (texture() & BTexture::Flat)) {
+    if (texture() & BTexture::Flat) {
+      if (descr.find("border") != string::npos)
+        addTexture(BTexture::Border);
+    } else {
       if (descr.find("bevel2") != string::npos)
         addTexture(BTexture::Bevel2);
       else
@@ -162,6 +161,7 @@ void BTexture::setDisplay(const BaseDisplay * const _display,
   ct.setDisplay(_display, _screen);
   lc.setDisplay(_display, _screen);
   sc.setDisplay(_display, _screen);
+  bc.setDisplay(_display, _screen);
 }
 
 
@@ -170,6 +170,7 @@ BTexture& BTexture::operator=(const BTexture &tt) {
   ct = tt.ct;
   lc = tt.lc;
   sc = tt.sc;
+  bc = tt.bc;
   descr = tt.descr;
   t  = tt.t;
   dpy = tt.dpy;
@@ -183,6 +184,7 @@ BTexture& BTexture::operator=(const BTexture &tt) {
 Pixmap BTexture::render(const unsigned int width, const unsigned int height,
                         const Pixmap old) {
   assert(display() != 0);
+  assert(texture() != BTexture::NoTexture);
 
   if (texture() == (BTexture::Flat | BTexture::Solid))
     return None;
This page took 0.024135 seconds and 4 git commands to generate.