make arrows larger, match th size of the other bullets. make all bullets' sizes quickly/easily adustable
This commit is contained in:
parent
8ff1b70973
commit
1525520dd1
3 changed files with 52 additions and 62 deletions
|
@ -636,28 +636,31 @@ void Basemenu::drawItem(int index, bool highlight, bool clear,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dosel && item->submenu()) {
|
if (dosel && item->submenu()) {
|
||||||
|
const int bullet_size = 3;
|
||||||
|
|
||||||
switch (screen->getMenuStyle()->bullet) {
|
switch (screen->getMenuStyle()->bullet) {
|
||||||
case Square:
|
case Square:
|
||||||
XDrawRectangle(display, menu.frame, pen.gc(), sel_x, sel_y, half_w, half_w);
|
XDrawRectangle(display, menu.frame, pen.gc(), sel_x, sel_y,
|
||||||
|
bullet_size * 2, bullet_size * 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Triangle:
|
case Triangle:
|
||||||
XPoint tri[3];
|
XPoint tri[3];
|
||||||
|
|
||||||
if (screen->getMenuStyle()->bullet_pos == Right) {
|
if (screen->getMenuStyle()->bullet_pos == Right) {
|
||||||
tri[0].x = sel_x + quarter_w - 2;
|
tri[0].x = sel_x + quarter_w - bullet_size;
|
||||||
tri[0].y = sel_y + quarter_w - 2;
|
tri[0].y = sel_y + quarter_w - bullet_size;
|
||||||
tri[1].x = 4;
|
tri[1].x = 2 * bullet_size;
|
||||||
tri[1].y = 2;
|
tri[1].y = bullet_size;
|
||||||
tri[2].x = -4;
|
tri[2].x = -(2 * bullet_size);
|
||||||
tri[2].y = 2;
|
tri[2].y = bullet_size;
|
||||||
} else {
|
} else {
|
||||||
tri[0].x = sel_x + quarter_w - 2;
|
tri[0].x = sel_x + quarter_w - bullet_size;
|
||||||
tri[0].y = item_y + half_w;
|
tri[0].y = item_y + half_w;
|
||||||
tri[1].x = 4;
|
tri[1].x = 2 * bullet_size;
|
||||||
tri[1].y = 2;
|
tri[1].y = bullet_size;
|
||||||
tri[2].x = 0;
|
tri[2].x = 0;
|
||||||
tri[2].y = -4;
|
tri[2].y = -(2 * bullet_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
XFillPolygon(display, menu.frame, pen.gc(), tri, 3, Convex,
|
XFillPolygon(display, menu.frame, pen.gc(), tri, 3, Convex,
|
||||||
|
@ -667,14 +670,14 @@ void Basemenu::drawItem(int index, bool highlight, bool clear,
|
||||||
case Diamond:
|
case Diamond:
|
||||||
XPoint dia[4];
|
XPoint dia[4];
|
||||||
|
|
||||||
dia[0].x = sel_x + quarter_w - 3;
|
dia[0].x = sel_x + quarter_w - bullet_size;
|
||||||
dia[0].y = item_y + half_w;
|
dia[0].y = item_y + half_w;
|
||||||
dia[1].x = 3;
|
dia[1].x = bullet_size;
|
||||||
dia[1].y = -3;
|
dia[1].y = -bullet_size;
|
||||||
dia[2].x = 3;
|
dia[2].x = bullet_size;
|
||||||
dia[2].y = 3;
|
dia[2].y = bullet_size;
|
||||||
dia[3].x = -3;
|
dia[3].x = -bullet_size;
|
||||||
dia[3].y = 3;
|
dia[3].y = bullet_size;
|
||||||
|
|
||||||
XFillPolygon(display, menu.frame, pen.gc(), dia, 4, Convex,
|
XFillPolygon(display, menu.frame, pen.gc(), dia, 4, Convex,
|
||||||
CoordModePrevious);
|
CoordModePrevious);
|
||||||
|
|
|
@ -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) {
|
void Toolbar::redrawPrevWorkspaceButton(bool pressed, bool redraw) {
|
||||||
if (redraw) {
|
if (redraw) {
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
|
@ -640,17 +666,7 @@ void Toolbar::redrawPrevWorkspaceButton(bool pressed, bool redraw) {
|
||||||
XClearWindow(display, frame.psbutton);
|
XClearWindow(display, frame.psbutton);
|
||||||
}
|
}
|
||||||
|
|
||||||
int hh = frame.button_w / 2, hw = frame.button_w / 2;
|
drawArrow(frame.psbutton, True);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -670,17 +686,7 @@ void Toolbar::redrawNextWorkspaceButton(bool pressed, bool redraw) {
|
||||||
XClearWindow(display, frame.nsbutton);
|
XClearWindow(display, frame.nsbutton);
|
||||||
}
|
}
|
||||||
|
|
||||||
int hh = frame.button_w / 2, hw = frame.button_w / 2;
|
drawArrow(frame.nsbutton, False);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -700,17 +706,7 @@ void Toolbar::redrawPrevWindowButton(bool pressed, bool redraw) {
|
||||||
XClearWindow(display, frame.pwbutton);
|
XClearWindow(display, frame.pwbutton);
|
||||||
}
|
}
|
||||||
|
|
||||||
int hh = frame.button_w / 2, hw = frame.button_w / 2;
|
drawArrow(frame.pwbutton, True);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -730,17 +726,7 @@ void Toolbar::redrawNextWindowButton(bool pressed, bool redraw) {
|
||||||
XClearWindow(display, frame.nwbutton);
|
XClearWindow(display, frame.nwbutton);
|
||||||
}
|
}
|
||||||
|
|
||||||
int hh = frame.button_w / 2, hw = frame.button_w / 2;
|
drawArrow(frame.nwbutton, False);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ private:
|
||||||
friend class Toolbarmenu;
|
friend class Toolbarmenu;
|
||||||
friend class Toolbarmenu::Placementmenu;
|
friend class Toolbarmenu::Placementmenu;
|
||||||
|
|
||||||
|
void drawArrow(Drawable surface, bool left) const;
|
||||||
void redrawPrevWorkspaceButton(bool pressed = False, bool redraw = False);
|
void redrawPrevWorkspaceButton(bool pressed = False, bool redraw = False);
|
||||||
void redrawNextWorkspaceButton(bool pressed = False, bool redraw = False);
|
void redrawNextWorkspaceButton(bool pressed = False, bool redraw = False);
|
||||||
void redrawPrevWindowButton(bool preseed = False, bool redraw = False);
|
void redrawPrevWindowButton(bool preseed = False, bool redraw = False);
|
||||||
|
|
Loading…
Reference in a new issue