Make dmenu full width
This commit is contained in:
parent
b319d66e78
commit
c67ba38005
13
dmenu.c
13
dmenu.c
|
@ -102,15 +102,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)
|
||||
{
|
||||
|
@ -793,7 +784,7 @@ setup(void)
|
|||
if (INTERSECT(x, y, 1, 1, info[i]))
|
||||
break;
|
||||
|
||||
mw = MIN(MAX(max_textw() + promptw, 100), info[i].width);
|
||||
mw = info[i].width;
|
||||
x = info[i].x_org + ((info[i].width - mw) / 2);
|
||||
y = info[i].y_org + ((info[i].height - mh) / 2);
|
||||
XFree(info);
|
||||
|
@ -803,7 +794,7 @@ setup(void)
|
|||
if (!XGetWindowAttributes(dpy, parentwin, &wa))
|
||||
die("could not get embedding window attributes: 0x%lx",
|
||||
parentwin);
|
||||
mw = MIN(MAX(max_textw() + promptw, 100), wa.width);
|
||||
mw = wa.width;
|
||||
x = (wa.width - mw) / 2;
|
||||
y = (wa.height - mh) / 2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue