X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FBasemenu.cc;h=775d49a882983f87e8b737c0cc7a22d0219a6c3a;hb=2dde696a1335ef61bb368c55f4ee52e1dd8610a1;hp=5b4acdf001009f2bf96b6f752c1e26a97158e157;hpb=b950402ba238aeb6d76604b761b6fdc249b070ab;p=chaz%2Fopenbox diff --git a/src/Basemenu.cc b/src/Basemenu.cc index 5b4acdf0..775d49a8 100644 --- a/src/Basemenu.cc +++ b/src/Basemenu.cc @@ -202,7 +202,7 @@ int Basemenu::insert(BasemenuItem *item, int pos) { if (pos < 0) { menuitems.push_back(item); } else { - assert(pos < static_cast(menuitems.size())); + assert(pos <= static_cast(menuitems.size())); menuitems.insert((menuitems.begin() + pos), item); } return menuitems.size(); @@ -636,28 +636,31 @@ void Basemenu::drawItem(int index, bool highlight, bool clear, } if (dosel && item->submenu()) { + const int bullet_size = 3; + switch (screen->getMenuStyle()->bullet) { 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; case Triangle: XPoint tri[3]; if (screen->getMenuStyle()->bullet_pos == Right) { - tri[0].x = sel_x + quarter_w - 2; - tri[0].y = sel_y + quarter_w - 2; - tri[1].x = 4; - tri[1].y = 2; - tri[2].x = -4; - tri[2].y = 2; + tri[0].x = sel_x + quarter_w - bullet_size; + tri[0].y = sel_y + quarter_w - bullet_size; + tri[1].x = 2 * bullet_size; + tri[1].y = bullet_size; + tri[2].x = -(2 * bullet_size); + tri[2].y = bullet_size; } 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[1].x = 4; - tri[1].y = 2; + tri[1].x = 2 * bullet_size; + tri[1].y = bullet_size; tri[2].x = 0; - tri[2].y = -4; + tri[2].y = -(2 * bullet_size); } XFillPolygon(display, menu.frame, pen.gc(), tri, 3, Convex, @@ -667,14 +670,14 @@ void Basemenu::drawItem(int index, bool highlight, bool clear, case Diamond: 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[1].x = 3; - dia[1].y = -3; - dia[2].x = 3; - dia[2].y = 3; - dia[3].x = -3; - dia[3].y = 3; + dia[1].x = bullet_size; + dia[1].y = -bullet_size; + dia[2].x = bullet_size; + dia[2].y = bullet_size; + dia[3].x = -bullet_size; + dia[3].y = bullet_size; XFillPolygon(display, menu.frame, pen.gc(), dia, 4, Convex, CoordModePrevious);