Browse Source

Partially revert 44c7de3: fix items text width offset calculation

Without this, we discard the item if it's longer than assigned width
instead of truncating it.
master
Quentin Rameau 8 years ago
committed by Hiltjo Posthuma
parent
commit
657122f781
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      dmenu.c

+ 2
- 2
dmenu.c View File

@ -81,10 +81,10 @@ calcoffsets(void)
n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
/* calculate which items will begin the next page and previous page */ /* calculate which items will begin the next page and previous page */
for (i = 0, next = curr; next; next = next->right) for (i = 0, next = curr; next; next = next->right)
if ((i += (lines > 0) ? bh : TEXTW(next->text)) > n)
if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n)
break; break;
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 : TEXTW(prev->left->text)) > n)
if ((i += (lines > 0) ? bh : MIN(TEXTW(prev->left->text), n)) > n)
break; break;
} }


Loading…
Cancel
Save