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).
This commit is contained in:
Gregory Heytings 2021-11-16 09:00:24 +01:00 committed by Lars Ingebrigtsen
parent 977f102a49
commit 24a817ccad
5 changed files with 15 additions and 1 deletions

View file

@ -406,6 +406,9 @@ the associated text. Default is 10.
@item shadowThickness
Thickness of shadow lines for 3D buttons, arrows, and other graphical
elements. Default is 1.
@item borderThickness
Thickness of the external borders of the menu bars and pop-up menus.
Default is 1.
@end ifnottex
@item margin
Margin of the menu bar, in characters. Default is 1.

View file

@ -46,6 +46,11 @@ time.
* Changes in Emacs 29.1
+++
** New X resource: "borderThickness".
This controls the thickness of the external borders of the menu bars
and pop-up menus.
** Terminal Emacs
---

View file

@ -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)

View file

@ -56,6 +56,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#define XtCResizeToPreferred "ResizeToPreferred"
#define XtNallowResize "allowResize"
#define XtCAllowResize "AllowResize"
#define XtNborderThickness "borderThickness"
#define XtCBorderThickness "BorderThickness"
/* Motif-compatible resource names */
#define XmNshadowThickness "shadowThickness"

View file

@ -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;