diff options
author | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2021-12-02 20:20:01 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2021-12-02 20:20:01 +0530 |
commit | d737a89aad20468dfa62239a0758c51a91fa7b9d (patch) | |
tree | ce55f91bf87e6a971997b256af0c5849ea7f3be4 /dmenu.c | |
parent | 12c61a33546358928777b584883c1e990ab09a21 (diff) |
Changed color scheme and fixed height
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 */ |