summaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-09-14 03:44:44 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-09-14 03:44:44 +0000
commitc2d992a35c11b8212bf390528d9828a815e8b5fd (patch)
treee18763492027436c9c21f73f06dba368240c9c6e /src/Toolbar.cc
parent499b1620c15830f06ae7aaf24183e4407e21770e (diff)
merged bitmap buttons
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc69
1 files changed, 54 insertions, 15 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 955eb5a0..8c2325b5 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -623,28 +623,67 @@ 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);
+ if (style->left_button.mask == None) {
+ 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);
+ } else {
+ 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,
+ (frame.button_w + style->left_button.w)/2,
+ (frame.button_w + style->left_button.h)/2);
+
+ XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
+ XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
+ }
} 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;
+ if (style->right_button.mask == None) {
+ 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);
+ } else {
+ 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);
+ }
}
-
- BPen pen(screen->getToolbarStyle()->b_pic);
- XFillPolygon(display, surface, pen.gc(), pts, 3, Convex, CoordModePrevious);
}