label pwd mode added

This commit is contained in:
Gabor
2017-06-13 14:17:33 +02:00
parent 26325e5ee6
commit 06cea6ed3a
4 changed files with 71 additions and 19 deletions

View File

@@ -298,9 +298,15 @@ void lv_draw_label(const area_t * cords_p,const area_t * mask_p, const lv_style_
}
}
if(cmd_state == CMD_STATE_IN) letter_fp(&pos, mask_p, font, txt[i], recolor, style->opa);
else letter_fp(&pos, mask_p, font, txt[i], style->ccolor, style->opa);
pos.x += (font_get_width(font, txt[i]) >> FONT_ANTIALIAS) + style->letter_space;
char letter = txt[i];
color_t color = style->ccolor;
if((flag & TXT_FLAG_PWD) != 0 && txt[i + 1] != '\0') letter = '*';
if(cmd_state == CMD_STATE_IN) color = recolor;
letter_fp(&pos, mask_p, font, letter, color, style->opa);
if((flag & TXT_FLAG_PWD) == 0 || txt[i + 1] == '\0') pos.x += (font_get_width(font, txt[i]) >> FONT_ANTIALIAS) + style->letter_space;
else pos.x += (font_get_width(font, '*') >> FONT_ANTIALIAS) + style->letter_space;
}
/*Go to next line*/
line_start = line_end;