emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 24a817c: New X resource to control the border thickness of menus


From: Lars Ingebrigtsen
Subject: master 24a817c: New X resource to control the border thickness of menus
Date: Tue, 16 Nov 2021 03:02:38 -0500 (EST)

branch: master
commit 24a817ccad7e67bd2bb0f23ea572073f36bdc3d9
Author: Gregory Heytings <gregory@heytings.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 doc/emacs/xresources.texi | 3 +++
 etc/NEWS                  | 5 +++++
 lwlib/xlwmenu.c           | 5 ++++-
 lwlib/xlwmenu.h           | 2 ++
 lwlib/xlwmenuP.h          | 1 +
 5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index 00fa6c0..0e00708 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -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.
diff --git a/etc/NEWS b/etc/NEWS
index 92ae8ac..ce4c86b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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
 
 ---
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index cc73d9a..702fad4 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 9143edb..89e548b 100644
--- a/lwlib/xlwmenu.h
+++ b/lwlib/xlwmenu.h
@@ -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"
diff --git a/lwlib/xlwmenuP.h b/lwlib/xlwmenuP.h
index fc77ec4..bb37b0d 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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]