]> git.eshelyaron.com Git - emacs.git/commitdiff
New X resource to control the border thickness of menus
authorGregory Heytings <gregory@heytings.org>
Tue, 16 Nov 2021 08:00:24 +0000 (09:00 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 16 Nov 2021 08:00:24 +0000 (09:00 +0100)
* 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).

doc/emacs/xresources.texi
etc/NEWS
lwlib/xlwmenu.c
lwlib/xlwmenu.h
lwlib/xlwmenuP.h

index 00fa6c0aa31fa27b91df3633a4bc956f4d462f2d..0e0070829c1b62bc6b967f5f976d2f6533d855da 100644 (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.
index 92ae8ac6243914a270d4f003af56a92b1585a04b..ce4c86b0c8bff190620c1766b0f398e555768272 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -46,6 +46,11 @@ time.
 \f
 * 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
 
 ---
index cc73d9aa498452dbc97168f53c598b910050b25a..702fad49ba67f9b91da40b8051b3477de5f4215a 100644 (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)
index 9143edba9a2d4c424111e8615939f950f127f5d5..89e548bc8da9fe6100e4ae7a7708cdd258683cd4 100644 (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"
index fc77ec4bfd1447ccef50e49bce397a05d69ac97a..bb37b0dee2ffdd2efd06dc935588e2b59ca3c560 100644 (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;