parent
9d19817dfa
commit
8f89a08af4
|
@ -39,6 +39,10 @@
|
||||||
#define draw_downarrow_raised(d, g1, g2, x, y, w, s) draw_arrow(d, g1, g2, x, y, w, s, DRAW_ARROW_DOWN)
|
#define draw_downarrow_raised(d, g1, g2, x, y, w, s) draw_arrow(d, g1, g2, x, y, w, s, DRAW_ARROW_DOWN)
|
||||||
#define draw_downarrow_clicked(d, g1, g2, x, y, w, s) draw_arrow(d, g2, g1, x, y, w, s, DRAW_ARROW_DOWN)
|
#define draw_downarrow_clicked(d, g1, g2, x, y, w, s) draw_arrow(d, g2, g1, x, y, w, s, DRAW_ARROW_DOWN)
|
||||||
|
|
||||||
|
#define DRAW_SOLID_BEVEL(d, w, h, p, u, s) draw_shadow_from_colors((d), ((u) ? get_top_shadow_color(p, "") : get_bottom_shadow_color(p, "")), \
|
||||||
|
((u) ? get_bottom_shadow_color(p, "") : get_top_shadow_color(p, "")), \
|
||||||
|
0, 0, (w), (h), (s));
|
||||||
|
|
||||||
/************ Structures ************/
|
/************ Structures ************/
|
||||||
|
|
||||||
/************ Variables ************/
|
/************ Variables ************/
|
||||||
|
|
14
src/menus.c
14
src/menus.c
|
@ -801,10 +801,16 @@ menu_reset_submenus(menu_t * menu)
|
||||||
void
|
void
|
||||||
menuitem_select(menu_t * menu)
|
menuitem_select(menu_t * menu)
|
||||||
{
|
{
|
||||||
|
static Pixel top = 0, bottom = 0;
|
||||||
menuitem_t *item;
|
menuitem_t *item;
|
||||||
|
|
||||||
ASSERT(menu != NULL);
|
ASSERT(menu != NULL);
|
||||||
|
|
||||||
|
if (top == 0) {
|
||||||
|
top = get_top_shadow_color(images[image_submenu].selected->bg, "submenu top shadow color");
|
||||||
|
bottom = get_bottom_shadow_color(images[image_submenu].selected->bg, "submenu bottom shadow color");
|
||||||
|
}
|
||||||
|
|
||||||
item = menuitem_get_current(menu);
|
item = menuitem_get_current(menu);
|
||||||
REQUIRE(item != NULL);
|
REQUIRE(item != NULL);
|
||||||
D_MENU(("Selecting new current item \"%s\" within menu \"%s\" (window 0x%08x, selection window 0x%08x)\n", item->text, menu->title, menu->win, menu->swin));
|
D_MENU(("Selecting new current item \"%s\" within menu \"%s\" (window 0x%08x, selection window 0x%08x)\n", item->text, menu->title, menu->win, menu->swin));
|
||||||
|
@ -816,10 +822,8 @@ menuitem_select(menu_t * menu)
|
||||||
if (image_mode_is(image_submenu, MODE_AUTO)) {
|
if (image_mode_is(image_submenu, MODE_AUTO)) {
|
||||||
enl_ipc_sync();
|
enl_ipc_sync();
|
||||||
} else if (!image_mode_is(image_submenu, MODE_MASK)) {
|
} else if (!image_mode_is(image_submenu, MODE_MASK)) {
|
||||||
draw_shadow_from_colors(menu->swin, PixColors[menuTopShadowColor], PixColors[menuBottomShadowColor],
|
draw_shadow_from_colors(menu->swin, top, bottom, 0, 0, item->w - MENU_VGAP, item->h, 2);
|
||||||
0, 0, item->w - MENU_VGAP, item->h, 2);
|
draw_arrow_from_colors(menu->swin, top, bottom, item->w - 3 * MENU_HGAP, (item->h - MENU_VGAP) / 2, MENU_VGAP, 2, DRAW_ARROW_RIGHT);
|
||||||
draw_arrow_from_colors(menu->swin, PixColors[menuTopShadowColor], PixColors[menuBottomShadowColor],
|
|
||||||
item->w - 3 * MENU_HGAP, (item->h - MENU_VGAP) / 2, MENU_VGAP, 2, DRAW_ARROW_RIGHT);
|
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
paste_simage(images[image_submenu].selected, image_submenu, menu->swin, 0, 0, item->w - MENU_VGAP, item->h);
|
paste_simage(images[image_submenu].selected, image_submenu, menu->swin, 0, 0, item->w - MENU_VGAP, item->h);
|
||||||
|
@ -828,7 +832,7 @@ menuitem_select(menu_t * menu)
|
||||||
if (image_mode_is(image_menu, MODE_MASK)) {
|
if (image_mode_is(image_menu, MODE_MASK)) {
|
||||||
render_simage(images[image_menu].selected, menu->swin, item->w - MENU_VGAP, item->h, image_menu, 0);
|
render_simage(images[image_menu].selected, menu->swin, item->w - MENU_VGAP, item->h, image_menu, 0);
|
||||||
} else {
|
} else {
|
||||||
draw_shadow_from_colors(menu->swin, PixColors[menuTopShadowColor], PixColors[menuBottomShadowColor], 0, 0, item->w - MENU_VGAP, item->h, 2);
|
draw_shadow_from_colors(menu->swin, top, bottom, 0, 0, item->w - MENU_VGAP, item->h, 2);
|
||||||
}
|
}
|
||||||
if (image_mode_is(image_menu, MODE_AUTO)) {
|
if (image_mode_is(image_menu, MODE_AUTO)) {
|
||||||
enl_ipc_sync();
|
enl_ipc_sync();
|
||||||
|
|
|
@ -1126,15 +1126,15 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
copy_buffer_pixmap(MODE_SOLID, (unsigned long) PixColors[bgColor], width, height);
|
copy_buffer_pixmap(MODE_SOLID, (unsigned long) PixColors[bgColor], width, height);
|
||||||
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
|
||||||
} else {
|
} else {
|
||||||
if (renderop & RENDER_FORCE_PIXMAP) {
|
if ((renderop & RENDER_FORCE_PIXMAP) || (simg->iml->bevel != NULL)) {
|
||||||
if (simg->pmap->pixmap) {
|
if (simg->pmap->pixmap) {
|
||||||
X_FREE_PIXMAP(simg->pmap->pixmap);
|
X_FREE_PIXMAP(simg->pmap->pixmap);
|
||||||
}
|
}
|
||||||
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
||||||
XSetForeground(Xdisplay, gc, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg)));
|
XSetForeground(Xdisplay, gc, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg)));
|
||||||
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
||||||
if (simg->iml->bevel != NULL) {
|
if (simg->iml->bevel != NULL && simg->iml->bevel->edges != NULL) {
|
||||||
bevel_pixmap(simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
|
DRAW_SOLID_BEVEL(simg->pmap->pixmap, width, height, simg->bg, simg->iml->bevel->up, simg->iml->bevel->edges->left);
|
||||||
}
|
}
|
||||||
/* FIXME: For efficiency, just fill the window with the pixmap
|
/* FIXME: For efficiency, just fill the window with the pixmap
|
||||||
and handle exposes by copying from simg->pmap->pixmap. */
|
and handle exposes by copying from simg->pmap->pixmap. */
|
||||||
|
|
Loading…
Reference in New Issue