Revert "Remove wmenu -P flag"

This reverts commit c05ab7520b.
This commit is contained in:
adnano 2024-05-04 21:44:59 -04:00
parent 963a677631
commit 15d7c7bcc2
5 changed files with 30 additions and 5 deletions

View file

@ -79,8 +79,22 @@ static void render_prompt(struct menu *menu, cairo_t *cairo) {
// Renders the input text.
static void render_input(struct menu *menu, cairo_t *cairo) {
render_text(menu, cairo, menu->input, menu->promptw, 0, 0,
0, menu->normalfg, menu->padding, menu->padding);
char *censort = NULL;
if (menu->passwd) {
censort = calloc(1, sizeof(menu->input));
if (!censort) {
return;
}
memset(censort, '*', strlen(menu->input));
}
render_text(menu, cairo, menu->passwd ? censort : menu->input,
menu->promptw, 0, 0, 0, menu->normalfg, menu->padding, menu->padding);
if (censort) {
free(censort);
}
}
// Renders a cursor for the input field.