X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fstyle.cc;h=f0aeddabc9d08cc57ac7e7115fc20fdbc4062571;hb=bc88d310fea71823fb2c61d071ff499579bffaba;hp=5aeef434a249532cc35ef213d08a44d034189249;hpb=06de24ec6666578759eff2b348e50f5e8e20f3bd;p=chaz%2Fopenbox diff --git a/otk/style.cc b/otk/style.cc index 5aeef434..f0aeddab 100644 --- a/otk/style.cc +++ b/otk/style.cc @@ -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,