From 8f89a08af4a2f658ae911fcd0e121cca9b499c18 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Sat, 15 Jul 2000 07:12:09 +0000 Subject: [PATCH] Move along, nothing to see here. SVN revision: 2919 --- src/draw.h | 4 ++++ src/menus.c | 14 +++++++++----- src/pixmap.c | 6 +++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/draw.h b/src/draw.h index 814493a..10e4cde 100644 --- a/src/draw.h +++ b/src/draw.h @@ -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_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 ************/ /************ Variables ************/ diff --git a/src/menus.c b/src/menus.c index 202b2b8..08100c8 100644 --- a/src/menus.c +++ b/src/menus.c @@ -801,10 +801,16 @@ menu_reset_submenus(menu_t * menu) void menuitem_select(menu_t * menu) { + static Pixel top = 0, bottom = 0; menuitem_t *item; 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); 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)); @@ -816,10 +822,8 @@ menuitem_select(menu_t * menu) if (image_mode_is(image_submenu, MODE_AUTO)) { enl_ipc_sync(); } else if (!image_mode_is(image_submenu, MODE_MASK)) { - draw_shadow_from_colors(menu->swin, PixColors[menuTopShadowColor], PixColors[menuBottomShadowColor], - 0, 0, item->w - MENU_VGAP, item->h, 2); - 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); + draw_shadow_from_colors(menu->swin, top, bottom, 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); } #if 0 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)) { render_simage(images[image_menu].selected, menu->swin, item->w - MENU_VGAP, item->h, image_menu, 0); } 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)) { enl_ipc_sync(); diff --git a/src/pixmap.c b/src/pixmap.c index c064a80..bf50eaf 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -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); XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap); } else { - if (renderop & RENDER_FORCE_PIXMAP) { + if ((renderop & RENDER_FORCE_PIXMAP) || (simg->iml->bevel != NULL)) { if (simg->pmap->pixmap) { X_FREE_PIXMAP(simg->pmap->pixmap); } simg->pmap->pixmap = X_CREATE_PIXMAP(width, height); XSetForeground(Xdisplay, gc, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg))); XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height); - if (simg->iml->bevel != NULL) { - bevel_pixmap(simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up); + if (simg->iml->bevel != NULL && simg->iml->bevel->edges != NULL) { + 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 and handle exposes by copying from simg->pmap->pixmap. */