fix some prompt width issues
This commit is contained in:
parent
1c6c041f5e
commit
ceec442bfe
25
libs/draw.c
25
libs/draw.c
|
@ -231,30 +231,27 @@ drawmenu(void)
|
||||||
// draw items and image
|
// draw items and image
|
||||||
if (lines > 0) {
|
if (lines > 0) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int xpad = 0;
|
int rx = 0;
|
||||||
|
|
||||||
// indent items to prompt width?
|
|
||||||
if (indentitems) {
|
|
||||||
xpad = 0; // x -= 0
|
|
||||||
} else {
|
|
||||||
xpad = promptw; // x -= prompt width so no indentation to prompt width
|
|
||||||
}
|
|
||||||
|
|
||||||
// draw image first
|
// draw image first
|
||||||
#if USEIMAGE
|
#if USEIMAGE
|
||||||
if (!hideimage && longestedge != 0) {
|
if (!hideimage && longestedge != 0) {
|
||||||
x = ox;
|
rx = ox;
|
||||||
x += (imagegaps * 2) + imagewidth;
|
rx += (imagegaps * 2) + imagewidth;
|
||||||
x += xpad;
|
} else
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
if (!indentitems) {
|
||||||
|
rx = 0;
|
||||||
|
} else {
|
||||||
|
rx = x;
|
||||||
|
}
|
||||||
|
|
||||||
for (item = curr; item != next; item = item->right, i++) {
|
for (item = curr; item != next; item = item->right, i++) {
|
||||||
drawitem(
|
drawitem(
|
||||||
item,
|
item,
|
||||||
x + ((i / lines) * ((mw - x) / columns)) - xpad,
|
rx + ((i / lines) * ((mw - rx) / columns)),
|
||||||
y + (((i % lines) + 1) * bh),
|
y + (((i % lines) + 1) * bh),
|
||||||
(mw - x) / columns
|
(mw - rx) / columns
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue