Add powerline for !lines as well
This commit is contained in:
parent
aa62ca8cdd
commit
9ba2e0f52f
|
@ -116,7 +116,7 @@ int drawitemtext(struct item *item, int x, int y, int w) {
|
|||
fga = itemn ? alpha_itemnormfg2 : alpha_itemnormfg;
|
||||
}
|
||||
|
||||
if (!hidepowerline && powerlineitems && selitem && lines > 0) {
|
||||
if (!hidepowerline && powerlineitems && selitem) {
|
||||
if (itempwlstyle == 2) {
|
||||
drw_circle(drw, x - plw, y, plw, bh, 0, col_menu, bgcol, alpha_menu, bga);
|
||||
} else {
|
||||
|
@ -262,7 +262,7 @@ int drawitemtext(struct item *item, int x, int y, int w) {
|
|||
item->clntext = malloc(sizeof(buffer));
|
||||
memcpy(item->clntext, buffer, sizeof(buffer));
|
||||
|
||||
if (!hidepowerline && powerlineitems && selitem && lines > 0) {
|
||||
if (!hidepowerline && powerlineitems && selitem) {
|
||||
if (itempwlstyle == 2) {
|
||||
drw_circle(drw, r, y, plw, bh, 1, col_menu, bgcol, alpha_menu, bga);
|
||||
} else {
|
||||
|
@ -347,7 +347,7 @@ int drawitem(int x, int y, int w) {
|
|||
int itemoverride = 1;
|
||||
|
||||
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 -
|
||||
rarrowWidth -
|
||||
numberWidth -
|
||||
|
|
4
spmenu.c
4
spmenu.c
|
@ -342,12 +342,12 @@ void calcoffsets(void) {
|
|||
|
||||
// calculate which items will begin the next page
|
||||
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;
|
||||
|
||||
// calculate which items will begin the previous page
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue