]> Dogcows Code - chaz/openbox/commitdiff
more bitmap merge fixes
authorScott Moynes <smoynes@nexus.carleton.ca>
Sat, 14 Sep 2002 04:52:04 +0000 (04:52 +0000)
committerScott Moynes <smoynes@nexus.carleton.ca>
Sat, 14 Sep 2002 04:52:04 +0000 (04:52 +0000)
src/Screen.cc
src/Window.cc

index 5d860bd70c21afd564c9d5cebec714c37334bf53..ea27d506dcafe6cc916745ce456425184daf9115 100644 (file)
@@ -1075,13 +1075,13 @@ void BScreen::LoadStyle(void) {
     resource.wstyle.icon_button.mask =
     resource.wstyle.icon_button.mask = None;
   
-  readDatabaseMask("window.button.close_mask", resource.wstyle.close_button,
+  readDatabaseMask("window.button.close.mask", resource.wstyle.close_button,
                    style);
-  readDatabaseMask("window.button.max_mask", resource.wstyle.max_button,
+  readDatabaseMask("window.button.max.mask", resource.wstyle.max_button,
                    style);
-  readDatabaseMask("window.button.icon_mask", resource.wstyle.icon_button,
+  readDatabaseMask("window.button.icon.mask", resource.wstyle.icon_button,
                    style);
-  readDatabaseMask("window.button.stick_mask", resource.wstyle.stick_button,
+  readDatabaseMask("window.button.stick.mask", resource.wstyle.stick_button,
                    style);
 
   // we create the window.frame texture by hand because it exists only to
@@ -1149,9 +1149,9 @@ void BScreen::LoadStyle(void) {
     readDatabaseColor("toolbar.clock.textColor", "white", style);
   resource.tstyle.b_pic =
     readDatabaseColor("toolbar.button.picColor", "black", style);
-  readDatabaseMask("toolbar.button.left_mask", resource.tstyle.left_button,
+  readDatabaseMask("toolbar.button.left.mask", resource.tstyle.left_button,
                    style);
-  readDatabaseMask("toolbar.button.right_mask", resource.tstyle.right_button,
+  readDatabaseMask("toolbar.button.right.mask", resource.tstyle.right_button,
                    style);
   
   resource.tstyle.justify = LeftJustify;
@@ -1190,7 +1190,7 @@ void BScreen::LoadStyle(void) {
     readDatabaseColor("menu.frame.disableColor", "black", style);
   resource.mstyle.h_text =
     readDatabaseColor("menu.hilite.textColor", "black", style);
-  readDatabaseMask("menu.bullet.mask", resource.mstyle.bullet_image, style);
+  readDatabaseMask("menu.arrow.mask", resource.mstyle.bullet_image, style);
   readDatabaseMask("menu.selected.mask", resource.mstyle.tick_image, style);
     
   resource.mstyle.t_justify = LeftJustify;
index 8a1b56845fb563206adcac1e5526f4fb1d6d4b03..a52633841a151eb47da8521ffa0340b782a6bc17 100644 (file)
@@ -2628,7 +2628,7 @@ void BlackboxWindow::redrawIconifyButton(bool pressed) const {
 
     XFillRectangle(blackbox->getXDisplay(), frame.iconify_button, pen.gc(),
                    (frame.button_w - pm.w)/2, (frame.button_w - pm.h)/2,
-                   pm.w, pm.h);
+                   (frame.button_w + pm.w)/2, (frame.button_w + pm.h)/2);
 
     XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
     XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
@@ -2679,7 +2679,7 @@ void BlackboxWindow::redrawMaximizeButton(bool pressed) const {
 
     XFillRectangle(blackbox->getXDisplay(), frame.maximize_button, pen.gc(),
                    (frame.button_w - pm.w)/2, (frame.button_w - pm.h)/2,
-                   pm.w, pm.h);
+                   (frame.button_w + pm.w)/2, (frame.button_w + pm.h)/2);
     
     XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0 );
     XSetClipMask( blackbox->getXDisplay(), pen.gc(), None );
@@ -2721,12 +2721,28 @@ void BlackboxWindow::redrawCloseButton(bool pressed) const {
 
   BPen pen((flags.focused) ? screen->getWindowStyle()->b_pic_focus :
            screen->getWindowStyle()->b_pic_unfocus);
-  XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
-            2, 2, (frame.button_w - 3), (frame.button_w - 3));
-  XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
-            2, (frame.button_w - 3), (frame.button_w - 3), 2);
-}
 
+  PixmapMask pm = screen->getWindowStyle()->close_button;
+
+  if (pm.mask != None) {
+    XSetClipMask(blackbox->getXDisplay(), pen.gc(), pm.mask);
+    XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
+                   (frame.button_w - pm.w)/2, (frame.button_w - pm.h)/2);
+    
+    XFillRectangle(blackbox->getXDisplay(), frame.close_button, pen.gc(),
+                   (frame.button_w - pm.w)/2, (frame.button_w - pm.h)/2,
+                   (frame.button_w + pm.w)/2, (frame.button_w + pm.h)/2);
+
+  
+    XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0 );
+    XSetClipMask( blackbox->getXDisplay(), pen.gc(), None );
+  } else {
+    XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
+              2, 2, (frame.button_w - 3), (frame.button_w - 3));
+    XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
+              2, (frame.button_w - 3), (frame.button_w - 3), 2);
+  }
+}
 
 void BlackboxWindow::redrawStickyButton(bool pressed) const {
   if (! pressed) {
@@ -2767,7 +2783,7 @@ void BlackboxWindow::redrawStickyButton(bool pressed) const {
     
     XFillRectangle(blackbox->getXDisplay(), frame.stick_button, pen.gc(),
                    (frame.button_w - pm.w)/2, (frame.button_w - pm.h)/2,
-                   pm.w, pm.h);
+                   (frame.button_w + pm.w)/2, (frame.button_w + pm.h)/2);
 
   
     XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0 );
@@ -3334,7 +3350,7 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root, int &dx) {
   bool focus = flags.focused; // had focus while moving?
 
   int dest_x = x_root;
-  if (x_root <= 0) {
+  if (x_root < 0) {
     dest_x += screen->getRect().width() - 1;
     dx += screen->getRect().width() - 1;
   } else {
This page took 0.027764 seconds and 4 git commands to generate.