summaryrefslogtreecommitdiff
path: root/dmenu.c.orig
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-10-29 18:07:03 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-10-29 18:07:03 +0530
commit5c474563c9f82e322b2ff23c2ed3f8250cb91ff2 (patch)
tree8d834f2e927b613409074f3d65cc8e109b041773 /dmenu.c.orig
parent722ca17501da98600d7be49b2856a4b37dfd65bf (diff)
applied center patch
Diffstat (limited to 'dmenu.c.orig')
-rw-r--r--dmenu.c.orig9
1 files changed, 7 insertions, 2 deletions
diff --git a/dmenu.c.orig b/dmenu.c.orig
index 1bd6b76..4bdbb71 100644
--- a/dmenu.c.orig
+++ b/dmenu.c.orig
@@ -182,7 +182,7 @@ drawmenu(void)
{
unsigned int curpos;
struct item *item;
- int x = 0, y = 0, w;
+ int x = 0, y = 0, fh = drw->fonts->h, w;
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, 0, 0, mw, mh, 1, 1);
@@ -199,7 +199,7 @@ drawmenu(void)
curpos = TEXTW(text) - TEXTW(&text[cursor]);
if ((curpos += lrpad / 2 - 1) < w) {
drw_setscheme(drw, scheme[SchemeNorm]);
- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
+ drw_rect(drw, x + curpos, 2 + (bh - fh) / 2, 2, fh - 4, 1, 0);
}
if (lines > 0) {
@@ -660,6 +660,7 @@ setup(void)
/* calculate menu geometry */
bh = drw->fonts->h + 2;
+ bh = MAX(bh,lineheight); /* make a menu line AT LEAST 'lineheight' tall */
lines = MAX(lines, 0);
mh = (lines + 1) * bh;
#ifdef XINERAMA
@@ -771,6 +772,10 @@ main(int argc, char *argv[])
/* these options take one argument */
else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */
lines = atoi(argv[++i]);
+ else if (!strcmp(argv[i], "-h")) { /* minimum height of one menu line */
+ lineheight = atoi(argv[++i]);
+ lineheight = MAX(lineheight, min_lineheight);
+ }
else if (!strcmp(argv[i], "-m"))
mon = atoi(argv[++i]);
else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */