new checkmark for the menus
This commit is contained in:
parent
c804a5a092
commit
f020fb586b
2 changed files with 27 additions and 23 deletions
|
@ -86,8 +86,7 @@ Basemenu::Basemenu(BScreen *scrn) {
|
||||||
|
|
||||||
menu.frame_pixmap =
|
menu.frame_pixmap =
|
||||||
menu.title_pixmap =
|
menu.title_pixmap =
|
||||||
menu.hilite_pixmap =
|
menu.hilite_pixmap = None;
|
||||||
menu.sel_pixmap = None;
|
|
||||||
|
|
||||||
menu.bevel_w = screen->getBevelWidth();
|
menu.bevel_w = screen->getBevelWidth();
|
||||||
|
|
||||||
|
@ -176,9 +175,6 @@ Basemenu::~Basemenu(void) {
|
||||||
if (menu.hilite_pixmap)
|
if (menu.hilite_pixmap)
|
||||||
image_ctrl->removeImage(menu.hilite_pixmap);
|
image_ctrl->removeImage(menu.hilite_pixmap);
|
||||||
|
|
||||||
if (menu.sel_pixmap)
|
|
||||||
image_ctrl->removeImage(menu.sel_pixmap);
|
|
||||||
|
|
||||||
blackbox->removeMenuSearch(menu.title);
|
blackbox->removeMenuSearch(menu.title);
|
||||||
XDestroyWindow(display, menu.title);
|
XDestroyWindow(display, menu.title);
|
||||||
|
|
||||||
|
@ -341,16 +337,6 @@ void Basemenu::update(void) {
|
||||||
}
|
}
|
||||||
if (tmp) image_ctrl->removeImage(tmp);
|
if (tmp) image_ctrl->removeImage(tmp);
|
||||||
|
|
||||||
tmp = menu.sel_pixmap;
|
|
||||||
if (texture->texture() == (BTexture::Flat | BTexture::Solid)) {
|
|
||||||
menu.sel_pixmap = None;
|
|
||||||
} else {
|
|
||||||
int hw = menu.item_h / 2;
|
|
||||||
menu.sel_pixmap =
|
|
||||||
image_ctrl->renderImage(hw, hw, *texture);
|
|
||||||
}
|
|
||||||
if (tmp) image_ctrl->removeImage(tmp);
|
|
||||||
|
|
||||||
XResizeWindow(display, menu.window, menu.width, menu.height);
|
XResizeWindow(display, menu.window, menu.width, menu.height);
|
||||||
|
|
||||||
if (title_vis)
|
if (title_vis)
|
||||||
|
@ -618,13 +604,31 @@ void Basemenu::drawItem(int index, bool highlight, bool clear,
|
||||||
else
|
else
|
||||||
XFillRectangle(display, menu.frame, hipen.gc(),
|
XFillRectangle(display, menu.frame, hipen.gc(),
|
||||||
hilite_x, hilite_y, hilite_w, hilite_h);
|
hilite_x, hilite_y, hilite_w, hilite_h);
|
||||||
} else if (dosel && item->isSelected() &&
|
}
|
||||||
(menu.sel_pixmap != ParentRelative)) {
|
|
||||||
if (menu.sel_pixmap)
|
if (dosel && item->isSelected()) {
|
||||||
XCopyArea(display, menu.sel_pixmap, menu.frame, hipen.gc(), 0, 0,
|
XPoint pts[6];
|
||||||
half_w, half_w, sel_x, sel_y);
|
|
||||||
else
|
pts[0].x = sel_x + 0;
|
||||||
XFillRectangle(display, menu.frame, hipen.gc(), sel_x, sel_y, half_w, half_w);
|
pts[0].y = sel_y + 2;
|
||||||
|
|
||||||
|
pts[1].x = 0;
|
||||||
|
pts[1].y = 3;
|
||||||
|
|
||||||
|
pts[2].x = 2;
|
||||||
|
pts[2].y = 3;
|
||||||
|
|
||||||
|
pts[3].x = 5;
|
||||||
|
pts[3].y = -5;
|
||||||
|
|
||||||
|
pts[4].x = 0;
|
||||||
|
pts[4].y = -3;
|
||||||
|
|
||||||
|
pts[5].x = -5;
|
||||||
|
pts[5].y = 5;
|
||||||
|
|
||||||
|
XFillPolygon(display, menu.frame, pen.gc(), pts, 6, Complex,
|
||||||
|
CoordModePrevious);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dotext && text) {
|
if (dotext && text) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ private:
|
||||||
int which_sub, which_press, which_sbl, alignment;
|
int which_sub, which_press, which_sbl, alignment;
|
||||||
|
|
||||||
struct _menu {
|
struct _menu {
|
||||||
Pixmap frame_pixmap, title_pixmap, hilite_pixmap, sel_pixmap;
|
Pixmap frame_pixmap, title_pixmap, hilite_pixmap;
|
||||||
Window window, frame, title;
|
Window window, frame, title;
|
||||||
|
|
||||||
std::string label;
|
std::string label;
|
||||||
|
|
Loading…
Reference in a new issue