commit ad2d3de3066c452649732126c87ee0850b393753
parent 6e101866943dda1c8cb66c7bb16a762ff4bc4c93
Author: regexghost <regexghost@protonmail.com>
Date: Wed, 22 Apr 2026 21:28:25 +0100
patch to add padding
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -2,6 +2,8 @@
/* Default settings; can be overriden by command line. */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
+static int horizpadbar = 2; /* horizontal padding */
+static int vertpadbar = 0; /* vertical padding */
static int centered = 1; /* -c option; centers dmenu on screen */
static int min_width = 500; /* minimum width when centered */
static const float menu_height_ratio = 4.0f; /* This is the ratio used in the original calculation */
diff --git a/dmenu.c b/dmenu.c
@@ -644,7 +644,7 @@ setup(void)
utf8 = XInternAtom(dpy, "UTF8_STRING", False);
/* calculate menu geometry */
- bh = drw->fonts->h + 2;
+ bh = drw->fonts->h + vertpadbar;
lines = MAX(lines, 0);
mh = (lines + 1) * bh;
promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
@@ -810,7 +810,7 @@ main(int argc, char *argv[])
drw = drw_create(dpy, screen, root, wa.width, wa.height);
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
die("no fonts could be loaded.");
- lrpad = drw->fonts->h;
+ lrpad = drw->fonts->h + horizpadbar;
#ifdef __OpenBSD__
if (pledge("stdio rpath", NULL) == -1)