diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-14 15:56:15 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-14 15:56:15 +0200 |
commit | 2bcb025b905973e3bb1edc0f8db749064a868059 (patch) | |
tree | 74104016e4e6b877d2e3f0e408df1a04fc7f1675 | |
parent | Fully patched (diff) | |
download | dmenu-2bcb025b905973e3bb1edc0f8db749064a868059.tar.gz dmenu-2bcb025b905973e3bb1edc0f8db749064a868059.tar.bz2 dmenu-2bcb025b905973e3bb1edc0f8db749064a868059.tar.xz dmenu-2bcb025b905973e3bb1edc0f8db749064a868059.tar.zst dmenu-2bcb025b905973e3bb1edc0f8db749064a868059.zip |
Removed numbers
-rw-r--r-- | dmenu.c | 25 |
1 files changed, 2 insertions, 23 deletions
@@ -24,8 +24,6 @@ * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org))) #define LENGTH(X) (sizeof X / sizeof X[0]) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) -#define NUMBERSMAXDIGITS 100 -#define NUMBERSBUFSIZE (NUMBERSMAXDIGITS * 2) + 1 /* enums */ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeNormHighlight, SchemeSelHighlight, SchemeLast }; /* color schemes */ @@ -36,7 +34,6 @@ struct item { int out; }; -static char numbers[NUMBERSBUFSIZE] = ""; static char text[BUFSIZ] = ""; static char *embed; static int bh, mw, mh; @@ -177,21 +174,6 @@ drawitem(struct item *item, int x, int y, int w) } static void -recalculatenumbers() -{ - unsigned int numer = 0, denom = 0; - struct item *item; - if (matchend) { - numer++; - for (item = matchend; item && item->left; item = item->left) - numer++; - } - for (item = items; item && item->text; item++) - denom++; - snprintf(numbers, NUMBERSBUFSIZE, "%d/%d", numer, denom); -} - -static void drawmenu(void) { unsigned int curpos; @@ -216,7 +198,6 @@ drawmenu(void) drw_rect(drw, x + curpos, 2 + (bh-fh)/2, 2, fh - 4, 1, 0); } - recalculatenumbers(); if (lines > 0) { /* draw vertical list */ for (item = curr; item != next; item = item->right) @@ -231,15 +212,13 @@ drawmenu(void) } x += w; for (item = curr; item != next; item = item->right) - x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">") - TEXTW(numbers))); + x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">"))); if (next) { w = TEXTW(">"); drw_setscheme(drw, scheme[SchemeNorm]); - drw_text(drw, mw - w - TEXTW(numbers), 0, w, bh, lrpad / 2, ">", 0); + drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0); } } - drw_setscheme(drw, scheme[SchemeNorm]); - drw_text(drw, mw - TEXTW(numbers), 0, TEXTW(numbers), bh, lrpad / 2, numbers, 0); drw_map(drw, win, 0, 0, mw, mh); } |