summaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-14 17:55:03 +0000
committerDana Jansens <danakj@orodu.net>2002-07-14 17:55:03 +0000
commit1525520dd177f7274ac5e2d2e95c5fa9027e0f48 (patch)
treee25f68b2c152c04819835a7f49f3597b465bdf9b /src/Toolbar.cc
parent8ff1b7097381bcd20567ea2dd615b4fec84d5a8b (diff)
make arrows larger, match th size of the other bullets. make all bullets' sizes quickly/easily adustable
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc74
1 files changed, 30 insertions, 44 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 23a45608..a2c3442b 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -624,6 +624,32 @@ void Toolbar::redrawWorkspaceLabel(bool redraw) {
}
+void Toolbar::drawArrow(Drawable surface, bool left) const {
+ 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);
+ } 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;
+ }
+
+ BPen pen(screen->getToolbarStyle()->b_pic);
+ XFillPolygon(display, surface, pen.gc(), pts, 3, Convex, CoordModePrevious);
+}
+
+
void Toolbar::redrawPrevWorkspaceButton(bool pressed, bool redraw) {
if (redraw) {
if (pressed) {
@@ -640,17 +666,7 @@ void Toolbar::redrawPrevWorkspaceButton(bool pressed, bool redraw) {
XClearWindow(display, frame.psbutton);
}
- int hh = frame.button_w / 2, hw = frame.button_w / 2;
-
- XPoint pts[3];
- pts[0].x = hw - 2; pts[0].y = hh;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = 0; pts[2].y = -4;
-
- ToolbarStyle *style = screen->getToolbarStyle();
- BPen pen(style->b_pic);
- XFillPolygon(display, frame.psbutton, pen.gc(),
- pts, 3, Convex, CoordModePrevious);
+ drawArrow(frame.psbutton, True);
}
@@ -670,17 +686,7 @@ void Toolbar::redrawNextWorkspaceButton(bool pressed, bool redraw) {
XClearWindow(display, frame.nsbutton);
}
- int hh = frame.button_w / 2, hw = frame.button_w / 2;
-
- XPoint pts[3];
- pts[0].x = hw - 2; pts[0].y = hh - 2;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = -4; pts[2].y = 2;
-
- ToolbarStyle *style = screen->getToolbarStyle();
- BPen pen(style->b_pic);
- XFillPolygon(display, frame.nsbutton, pen.gc(),
- pts, 3, Convex, CoordModePrevious);
+ drawArrow(frame.nsbutton, False);
}
@@ -700,17 +706,7 @@ void Toolbar::redrawPrevWindowButton(bool pressed, bool redraw) {
XClearWindow(display, frame.pwbutton);
}
- int hh = frame.button_w / 2, hw = frame.button_w / 2;
-
- XPoint pts[3];
- pts[0].x = hw - 2; pts[0].y = hh;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = 0; pts[2].y = -4;
-
- ToolbarStyle *style = screen->getToolbarStyle();
- BPen pen(style->b_pic);
- XFillPolygon(display, frame.pwbutton, pen.gc(),
- pts, 3, Convex, CoordModePrevious);
+ drawArrow(frame.pwbutton, True);
}
@@ -730,17 +726,7 @@ void Toolbar::redrawNextWindowButton(bool pressed, bool redraw) {
XClearWindow(display, frame.nwbutton);
}
- int hh = frame.button_w / 2, hw = frame.button_w / 2;
-
- XPoint pts[3];
- pts[0].x = hw - 2; pts[0].y = hh - 2;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = -4; pts[2].y = 2;
-
- ToolbarStyle *style = screen->getToolbarStyle();
- BPen pen(style->b_pic);
- XFillPolygon(display, frame.nwbutton, pen.gc(), pts, 3, Convex,
- CoordModePrevious);
+ drawArrow(frame.nwbutton, False);
}