summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2021-11-16 09:00:24 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-11-16 09:00:24 +0100
commit24a817ccad7e67bd2bb0f23ea572073f36bdc3d9 (patch)
tree438a44f909dbfc9b1637d21d8bb0c4b10600a1fb /lwlib
parent977f102a49749e09cec1766158ec617704606089 (diff)
downloademacs-24a817ccad7e67bd2bb0f23ea572073f36bdc3d9.tar.gz
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).
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/xlwmenu.c5
-rw-r--r--lwlib/xlwmenu.h2
-rw-r--r--lwlib/xlwmenuP.h1
3 files changed, 7 insertions, 1 deletions
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 <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 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;