From: Scott Moynes Date: Sat, 14 Sep 2002 04:52:04 +0000 (+0000) Subject: more bitmap merge fixes X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=c196ecd8783e5640380ad1b5f55bcd860abd0c62;p=chaz%2Fopenbox more bitmap merge fixes --- diff --git a/src/Screen.cc b/src/Screen.cc index 5d860bd7..ea27d506 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -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; diff --git a/src/Window.cc b/src/Window.cc index 8a1b5684..a5263384 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -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 {