From 108b72af46217a2c52e87d5952a86acaba6307b1 Mon Sep 17 00:00:00 2001 From: speedie Date: Wed, 5 Apr 2023 18:58:48 +0200 Subject: [PATCH] last commit for drawinput(); --- libs/draw.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/draw.c b/libs/draw.c index 9e966a0..3e7d762 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -265,8 +265,8 @@ drawinput(int x, int y, int w) int fh = drw->font->h; // draw input - w = (lines > 0 || !matches) ? mw - x : inputw; drw_setscheme(drw, scheme[SchemeInput]); + if (passwd && !hideprompt) { censort = ecalloc(1, sizeof(text)); @@ -274,7 +274,7 @@ drawinput(int x, int y, int w) memcpy(&censort[i], password, strlen(text)); apply_fribidi(censort); - drw_text(drw, x, 0, w, bh, lrpad / 2, isrtl ? fribidi_text : censort, 0, pango_password ? True : False); + drw_text(drw, x, y, w, bh, lrpad / 2, isrtl ? fribidi_text : censort, 0, pango_password ? True : False); curpos = TEXTW(censort) - TEXTW(&text[cursor]); @@ -409,7 +409,12 @@ drawmenu(void) w = promptw; x = drawprompt(x, 0, w); } - if (!hideinput) x = drawinput(x, y, w); + if (!hideinput) { + w = (lines > 0 || !matches) ? mw - x : inputw; + x = drawinput(x, 0, w); + } + + if (!hidemode) modeWidth = pango_mode ? TEXTWM(modetext) : TEXTW(modetext); // draw the items, this function also calls drawrarrow() and drawlarrow()