diff options
-rw-r--r-- | config.def.h | 2 | ||||
-rw-r--r-- | dmenu.c | 13 |
2 files changed, 3 insertions, 12 deletions
diff --git a/config.def.h b/config.def.h index 70b495d..2602882 100644 --- a/config.def.h +++ b/config.def.h @@ -3,7 +3,7 @@ static int topbar = 0; /* -b option; if 0, dmenu appears at bottom */ static int centered = 0; /* -c option; centers dmenu on screen */ -static int min_width = 500; /* minimum width when centered */ +static int centered_width = 800; /* width when centered */ /* -fn option overrides fonts[0]; default X11 font or font set */ static const char *fonts[] = { "monospace:size=11" @@ -96,15 +96,6 @@ calcoffsets(void) break; } -static int -max_textw(void) -{ - int len = 0; - for (struct item *item = items; item && item->text; item++) - len = MAX(TEXTW(item->text), len); - return len; -} - static void cleanup(void) { @@ -677,7 +668,7 @@ setup(void) break; if (centered) { - mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width); + mw = centered_width; x = info[i].x_org + ((info[i].width - mw) / 2); y = info[i].y_org + ((info[i].height - mh) / 2); } else { @@ -695,7 +686,7 @@ setup(void) parentwin); if (centered) { - mw = MIN(MAX(max_textw() + promptw, min_width), wa.width); + mw = centered_width; x = (wa.width - mw) / 2; y = (wa.height - mh) / 2; } else { |