]> Dogcows Code - chaz/openbox/blobdiff - otk/style.cc
in synch mode, chew up 100% cpu, cuz we cant select on the display's fd
[chaz/openbox] / otk / style.cc
index a3d21788d5fb8871e36e2af2ccec68997be73e40..fe34bbf41ec1c5e92f931e6470e2b5ac63f761ab 100644 (file)
@@ -19,7 +19,7 @@ Style::Style() : font(NULL)
 
 Style::Style(BImageControl *ctrl)
   : image_control(ctrl), font(0),
-    screen_number(ctrl->getScreenInfo()->getScreenNumber())
+    screen_number(ctrl->getScreenInfo()->screen())
 {
 }
 
@@ -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);
@@ -136,7 +144,7 @@ void Style::load(const Configuration &style) {
   // load bevel, border and handle widths
 
   const ScreenInfo *s_info = OBDisplay::screenInfo(screen_number);
-  unsigned int width = s_info->getRect().width();
+  unsigned int width = s_info->rect().width();
 
   if (! style.getValue("handleWidth", handle_width) ||
       handle_width > width/2 || handle_width == 0)
@@ -160,15 +168,13 @@ void Style::load(const Configuration &style) {
 
 void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask,
                              const Configuration &style) {
-  Window root_window = OBDisplay::screenInfo(screen_number)->getRootWindow();
+  Window root_window = OBDisplay::screenInfo(screen_number)->rootWindow();
   std::string s;
   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,
@@ -252,7 +258,7 @@ BFont *Style::readDatabaseFont(const std::string &rbasename,
     tint = atoi(s.c_str());
   }
 
-  fontstring = "Arial,Sans-8:bold";
+  fontstring = "Arial,Sans-9:bold";
 
   // if this fails, it ::exit()'s
   return new BFont(screen_number, fontstring, dropShadow, offset, tint);
This page took 0.023981 seconds and 4 git commands to generate.