Applied tsv patch (the simple version)
This commit is contained in:
parent
1a13d0465d
commit
c05e52af45
9
dmenu.c
9
dmenu.c
@ -30,6 +30,7 @@ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
|
||||
|
||||
struct item {
|
||||
char *text;
|
||||
char *stext;
|
||||
struct item *left, *right;
|
||||
int out;
|
||||
};
|
||||
@ -123,7 +124,7 @@ drawitem(struct item *item, int x, int y, int w)
|
||||
else
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
|
||||
return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
|
||||
return drw_text(drw, x, y, w, bh, lrpad / 2, item->stext, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -165,7 +166,7 @@ drawmenu(void)
|
||||
}
|
||||
x += w;
|
||||
for (item = curr; item != next; item = item->right)
|
||||
x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">")));
|
||||
x = drawitem(item, x, 0, MIN(TEXTW(item->stext), mw - x - TEXTW(">")));
|
||||
if (next) {
|
||||
w = TEXTW(">");
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
@ -534,6 +535,10 @@ readstdin(void)
|
||||
*p = '\0';
|
||||
if (!(items[i].text = strdup(buf)))
|
||||
die("cannot strdup %u bytes:", strlen(buf) + 1);
|
||||
if ((p = strchr(buf, '\t')))
|
||||
*p = '\0';
|
||||
if (!(items[i].stext = strdup(buf)))
|
||||
die("cannot strdup %u bytes:", strlen(buf) + 1);
|
||||
items[i].out = 0;
|
||||
drw_font_getexts(drw->fonts, buf, strlen(buf), &tmpmax, NULL);
|
||||
if (tmpmax > inputw) {
|
||||
|
Loading…
Reference in New Issue
Block a user