From 24a817ccad7e67bd2bb0f23ea572073f36bdc3d9 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Tue, 16 Nov 2021 09:00:24 +0100 Subject: New X resource to control the border thickness of menus * lwlib/xlwmenu.h (XtNborderThickness, XtCBorderThickness): New X resource name. * lwlib/xlwmenuP.h (XlwMenuPart): New border_thickness field. * lwlib/xlwmenu.c (xlwMenuResources): Access the new resource. (draw_shadow_rectangle): Use the new resource value. * doc/emacs/xresources.texi (Lucid Resources): Document the new resource (bug#51867). --- lwlib/xlwmenu.c | 5 ++++- lwlib/xlwmenu.h | 2 ++ lwlib/xlwmenuP.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lwlib') diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index cc73d9aa498..702fad49ba6 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -157,6 +157,9 @@ xlwMenuResources[] = offset(menu.cursor_shape), XtRString, (XtPointer)"right_ptr"}, {XtNhorizontal, XtCHorizontal, XtRInt, sizeof(int), offset(menu.horizontal), XtRImmediate, (XtPointer)True}, + {XtNborderThickness, XtCBorderThickness, XtRDimension, + sizeof (Dimension), offset (menu.border_thickness), + XtRImmediate, (XtPointer)1} }; #undef offset @@ -635,7 +638,7 @@ draw_shadow_rectangle (XlwMenuWidget mw, Display *dpy = XtDisplay (mw); GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc; GC bottom_gc = !erase_p ? mw->menu.shadow_bottom_gc : mw->menu.background_gc; - int thickness = mw->menu.shadow_thickness; + int thickness = !x && !y ? mw->menu.border_thickness : mw->menu.shadow_thickness; XPoint points [4]; if (!erase_p && down_p) diff --git a/lwlib/xlwmenu.h b/lwlib/xlwmenu.h index 9143edba9a2..89e548bc8da 100644 --- a/lwlib/xlwmenu.h +++ b/lwlib/xlwmenu.h @@ -56,6 +56,8 @@ along with GNU Emacs. If not, see . */ #define XtCResizeToPreferred "ResizeToPreferred" #define XtNallowResize "allowResize" #define XtCAllowResize "AllowResize" +#define XtNborderThickness "borderThickness" +#define XtCBorderThickness "BorderThickness" /* Motif-compatible resource names */ #define XmNshadowThickness "shadowThickness" diff --git a/lwlib/xlwmenuP.h b/lwlib/xlwmenuP.h index fc77ec4bfd1..bb37b0dee2f 100644 --- a/lwlib/xlwmenuP.h +++ b/lwlib/xlwmenuP.h @@ -75,6 +75,7 @@ typedef struct _XlwMenu_part Dimension vertical_spacing; Dimension arrow_spacing; Dimension shadow_thickness; + Dimension border_thickness; Pixel top_shadow_color; Pixel bottom_shadow_color; Pixmap top_shadow_pixmap; -- cgit v1.2.1