]> Dogcows Code - chaz/openbox/blobdiff - otk/style.cc
fix \'s
[chaz/openbox] / otk / style.cc
index 5aeef434a249532cc35ef213d08a44d034189249..f0aeddabc9d08cc57ac7e7115fc20fdbc4062571 100644 (file)
@@ -66,13 +66,21 @@ void Style::load(const Configuration &style) {
 
   b_focus = readDatabaseTexture("window.button.focus", "white", style);
   b_unfocus = readDatabaseTexture("window.button.unfocus", "black", style);
-  b_pressed = readDatabaseTexture("window.button.pressed", "black", style);
 
   //if neither of these can be found, we will use the previous resource
   b_pressed_focus = readDatabaseTexture("window.button.pressed.focus",
                                         "black", style, true);
+  if (b_pressed_focus.texture() == BTexture::NoTexture) {
+    b_pressed_focus = readDatabaseTexture("window.button.pressed", "black",
+                                          style);
+  }
+    
   b_pressed_unfocus = readDatabaseTexture("window.button.pressed.unfocus",
                                           "black", style, true);
+  if (b_pressed_unfocus.texture() == BTexture::NoTexture) {
+    b_pressed_unfocus = readDatabaseTexture("window.button.pressed", "black",
+                                            style);
+  }
 
   if (close_button.mask != None)
     XFreePixmap(OBDisplay::display, close_button.mask);
@@ -165,14 +173,18 @@ void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask,
   int hx, hy; //ignored
   int ret = BitmapOpenFailed; //default to failure.
   
-  if (style.getValue(rname, s))
-  {
-    if (s[0] != '/' && s[0] != '~')
-    {
+  if (style.getValue(rname, s)) {
+    if (s[0] != '/' && s[0] != '~') {
       std::string xbmFile = std::string("~/.openbox/buttons/") + s;
       ret = XReadBitmapFile(OBDisplay::display, root_window,
                             expandTilde(xbmFile).c_str(), &pixmapMask.w,
                             &pixmapMask.h, &pixmapMask.mask, &hx, &hy);
+      if (ret != BitmapSuccess) {
+        xbmFile = std::string(BUTTONSDIR) + "/" + s;
+        ret = XReadBitmapFile(OBDisplay::display, root_window,
+                              xbmFile.c_str(), &pixmapMask.w,
+                              &pixmapMask.h, &pixmapMask.mask, &hx, &hy);
+      }
     } else
       ret = XReadBitmapFile(OBDisplay::display, root_window,
                             expandTilde(s).c_str(), &pixmapMask.w,
This page took 0.021524 seconds and 4 git commands to generate.