---- - dmenu.c | 28 ++++++++--- - drw.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - drw.h | 2 + - 3 files changed, 191 insertions(+), 8 deletions(-) - diff --git a/dmenu.c b/dmenu.c -index a246111..d51b404 100644 +index 5c835dd..71efe52 100644 --- a/dmenu.c +++ b/dmenu.c -_AT_@ -128,9 +128,11 @@ drawitem(struct item *item, int x, int y, int w) +_AT_@ -131,9 +131,10 @@ drawitem(struct item *item, int x, int y, int w) static void drawmenu(void) { _AT_@ -25,11 +11,10 @@ index a246111..d51b404 100644 struct item *item; int x = 0, y = 0, w; + int curlen, rcurlen; -+ char ch; drw_setscheme(drw, scheme[SchemeNorm]); drw_rect(drw, 0, 0, mw, mh, 1, 1); -_AT_@ -141,14 +143,24 @@ drawmenu(void) +_AT_@ -144,14 +145,21 @@ drawmenu(void) } /* draw input field */ w = (lines > 0 || !matches) ? mw - x : inputw; _AT_@ -37,23 +22,20 @@ index a246111..d51b404 100644 - drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0); + w -= lrpad / 2; + x += lrpad / 2; -+ -+ ch = text[cursor]; -+ text[cursor] = '-+ curlen = drw_fontset_getwidth(drw, text); -+ text[cursor] = ch; + +- curpos = TEXTW(text) - TEXTW(&text[cursor]); +- if ((curpos += lrpad / 2 - 1) < w) { +- drw_setscheme(drw, scheme[SchemeNorm]); +- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0); +- } + rcurlen = drw_fontset_getwidth(drw, text + cursor); ++ curlen = drw_fontset_getwidth(drw, text) - rcurlen; + curpos += curlen - oldcurlen; + curpos = MIN(w, MAX(0, curpos)); + curpos = MAX(curpos, w - rcurlen); + curpos = MIN(curpos, curlen); + oldcurlen = curlen; - -- drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL); -- if ((curpos += lrpad / 2 - 1) < w) { -- drw_setscheme(drw, scheme[SchemeNorm]); -- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0); -- } ++ + drw_setscheme(drw, scheme[SchemeNorm]); + drw_text_align(drw, x, 0, curpos, bh, text, cursor, AlignR); + drw_text_align(drw, x + curpos, 0, w - curpos, bh, text + cursor, strlen(text) - cursor, AlignL); _AT_@ -261,6 +243,3 @@ index 4c67419..b66a83e 100644 /* Map functions */ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); --- -2.15.1 - diff --git a/tools.suckless.org/dmenu/patches/scroll.md b/tools.suckless.org/dmenu/patches/scroll.md index 96033361..58b6861b 100644 --- a/tools.suckless.org/dmenu/patches/scroll.md +++ b/tools.suckless.org/dmenu/patches/scroll.md _AT_@ -7,7 +7,7 @@ in surf, after having inserted a long url via tab-completion. Download -------- -* [dmenu-scroll-20180224-8895128.diff](dmenu-scroll-20180224-8895128.diff) +* [dmenu-scroll-20180607-a314412.diff](dmenu-scroll-20180607-a314412.diff) Author ------Received on Thu Jun 07 2018 - 07:09:30 CEST
This archive was generated by hypermail 2.3.0 : Thu Jun 07 2018 - 07:12:30 CEST