X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FToolbar.cc;h=d2e2f15f717118ec3c073a276a8c4c75d7f66092;hb=2037631f753753a5c1ee9b2475b55658c3bb6eea;hp=955eb5a05223ed47384a204c2e7a2a2f187fa2de;hpb=72c56d793b21cb0dae7a6a3d0baf580dacc4a34f;p=chaz%2Fopenbox diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 955eb5a0..d2e2f15f 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -623,28 +623,74 @@ void Toolbar::redrawWorkspaceLabel(bool redraw) { void Toolbar::drawArrow(Drawable surface, bool left) const { + ToolbarStyle *style = screen->getToolbarStyle(); + + BPen pen(style->b_pic); + int hh = frame.button_w / 2, hw = frame.button_w / 2; XPoint pts[3]; const int bullet_size = 3; + if (left) { - pts[0].x = hw - bullet_size; - pts[0].y = hh; - pts[1].x = 2 * bullet_size; - pts[1].y = bullet_size; - pts[2].x = 0; - pts[2].y = -(2 * bullet_size); +#ifdef BITMAPBUTTONS + if (style->left_button.mask != None) { + XSetClipMask(blackbox->getXDisplay(), pen.gc(), style->left_button.mask); + XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), + (frame.button_w - style->left_button.w)/2, + (frame.button_w - style->left_button.h)/2); + + XFillRectangle(blackbox->getXDisplay(), surface, pen.gc(), + (frame.button_w - style->left_button.w)/2, + (frame.button_w - style->left_button.h)/2, + style->left_button.w, style->left_button.h); + + XSetClipMask(blackbox->getXDisplay(), pen.gc(), None); + XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0); + } else { +#endif // BITMAPBUTTONS + pts[0].x = hw - bullet_size; + pts[0].y = hh; + pts[1].x = 2 * bullet_size; + pts[1].y = bullet_size; + pts[2].x = 0; + pts[2].y = -(2 * bullet_size); + XFillPolygon(display, surface, pen.gc(), pts, 3, Convex, + CoordModePrevious); +#ifdef BITMAPBUTTONS + } +#endif // BITMAPBUTTONS } else { - pts[0].x = hw - bullet_size; - pts[0].y = hh - bullet_size; - pts[1].x = (2 * bullet_size); - pts[1].y = bullet_size; - pts[2].x = -(2 * bullet_size); - pts[2].y = bullet_size; +#ifdef BITMAPBUTTONS + if (style->right_button.mask != None) { + XSetClipMask(blackbox->getXDisplay(), pen.gc(), + style->right_button.mask); + XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), + (frame.button_w - style->right_button.w)/2, + (frame.button_w - style->right_button.h)/2); + + XFillRectangle(blackbox->getXDisplay(), surface, pen.gc(), + (frame.button_w - style->right_button.w)/2, + (frame.button_w - style->right_button.h)/2, + (frame.button_w + style->right_button.w)/2, + (frame.button_w + style->right_button.h)/2); + + XSetClipMask(blackbox->getXDisplay(), pen.gc(), None); + XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0); + } else { +#endif // BITMAPBUTTONS + pts[0].x = hw - bullet_size; + pts[0].y = hh - bullet_size; + pts[1].x = (2 * bullet_size); + pts[1].y = bullet_size; + pts[2].x = -(2 * bullet_size); + pts[2].y = bullet_size; + XFillPolygon(display, surface, pen.gc(), pts, 3, Convex, + CoordModePrevious); +#ifdef BITMAPBUTTONS + } +#endif } - - BPen pen(screen->getToolbarStyle()->b_pic); - XFillPolygon(display, surface, pen.gc(), pts, 3, Convex, CoordModePrevious); }