Add powerline for !lines as well

This commit is contained in:
speedie 2023-06-18 21:15:32 +02:00
parent aa62ca8cdd
commit 9ba2e0f52f
2 changed files with 5 additions and 5 deletions

View file

@ -116,7 +116,7 @@ int drawitemtext(struct item *item, int x, int y, int w) {
fga = itemn ? alpha_itemnormfg2 : alpha_itemnormfg; fga = itemn ? alpha_itemnormfg2 : alpha_itemnormfg;
} }
if (!hidepowerline && powerlineitems && selitem && lines > 0) { if (!hidepowerline && powerlineitems && selitem) {
if (itempwlstyle == 2) { if (itempwlstyle == 2) {
drw_circle(drw, x - plw, y, plw, bh, 0, col_menu, bgcol, alpha_menu, bga); drw_circle(drw, x - plw, y, plw, bh, 0, col_menu, bgcol, alpha_menu, bga);
} else { } else {
@ -262,7 +262,7 @@ int drawitemtext(struct item *item, int x, int y, int w) {
item->clntext = malloc(sizeof(buffer)); item->clntext = malloc(sizeof(buffer));
memcpy(item->clntext, buffer, sizeof(buffer)); memcpy(item->clntext, buffer, sizeof(buffer));
if (!hidepowerline && powerlineitems && selitem && lines > 0) { if (!hidepowerline && powerlineitems && selitem) {
if (itempwlstyle == 2) { if (itempwlstyle == 2) {
drw_circle(drw, r, y, plw, bh, 1, col_menu, bgcol, alpha_menu, bga); drw_circle(drw, r, y, plw, bh, 1, col_menu, bgcol, alpha_menu, bga);
} else { } else {
@ -347,7 +347,7 @@ int drawitem(int x, int y, int w) {
int itemoverride = 1; int itemoverride = 1;
for (item = curr; item != next; item = item->right) { // draw items for (item = curr; item != next; item = item->right) { // draw items
x = drawitemtext(item, x, y, MIN(pango_item ? TEXTWM(item->text) : TEXTW(item->text), x = drawitemtext(item, x + (powerlineitems ? plw : 0), y, MIN(pango_item ? TEXTWM(item->text) : TEXTW(item->text),
mw - x - mw - x -
rarrowWidth - rarrowWidth -
numberWidth - numberWidth -

View file

@ -342,12 +342,12 @@ void calcoffsets(void) {
// calculate which items will begin the next page // calculate which items will begin the next page
for (i = 0, next = curr; next; next = next->right) for (i = 0, next = curr; next; next = next->right)
if ((i += (lines > 0) ? bh : MIN(TEXTWM(next->text), n)) > n) if ((i += (lines > 0) ? bh : MIN(TEXTWM(next->text) + (powerlineitems ? !lines ? 2 * plw : 0 : 0), n)) > n)
break; break;
// calculate which items will begin the previous page // calculate which items will begin the previous page
for (i = 0, prev = curr; prev && prev->left; prev = prev->left) for (i = 0, prev = curr; prev && prev->left; prev = prev->left)
if ((i += (lines > 0) ? bh : MIN(TEXTWM(prev->left->text), n)) > n) if ((i += (lines > 0) ? bh : MIN(TEXTWM(prev->left->text) + (powerlineitems ? !lines ? 2 * plw : 0 : 0), n)) > n)
break; break;
} }