mirror of
https://github.com/mintycube/dmenu.git
synced 2024-10-22 14:05:48 +02:00
xyw vs center patch - allow xyw control the width of dmenu when centered ref. #29
This commit is contained in:
parent
9ef1b3c317
commit
d04595790f
8
dmenu.c
8
dmenu.c
@ -1645,7 +1645,11 @@ setup(void)
|
|||||||
|
|
||||||
#if CENTER_PATCH
|
#if CENTER_PATCH
|
||||||
if (center) {
|
if (center) {
|
||||||
|
#if XYW_PATCH
|
||||||
|
mw = (dmw>0 ? dmw : MIN(MAX(max_textw() + promptw, min_width), info[i].width));
|
||||||
|
#else
|
||||||
mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
|
mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
|
||||||
|
#endif // XYW_PATCH
|
||||||
x = info[i].x_org + ((info[i].width - mw) / 2);
|
x = info[i].x_org + ((info[i].width - mw) / 2);
|
||||||
y = info[i].y_org + ((info[i].height - mh) / 2);
|
y = info[i].y_org + ((info[i].height - mh) / 2);
|
||||||
} else {
|
} else {
|
||||||
@ -1677,7 +1681,11 @@ setup(void)
|
|||||||
parentwin);
|
parentwin);
|
||||||
#if CENTER_PATCH
|
#if CENTER_PATCH
|
||||||
if (center) {
|
if (center) {
|
||||||
|
#if XYW_PATCH
|
||||||
|
mw = (dmw>0 ? dmw : MIN(MAX(max_textw() + promptw, min_width), wa.width));
|
||||||
|
#else
|
||||||
mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
|
mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
|
||||||
|
#endif // XYW_PATCH
|
||||||
x = (wa.width - mw) / 2;
|
x = (wa.width - mw) / 2;
|
||||||
y = (wa.height - mh) / 2;
|
y = (wa.height - mh) / 2;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user