WIP allow non-ascii chars for password input

This commit is contained in:
Stephen Seo 2021-12-15 16:52:21 +09:00
parent 4eefb74eee
commit 432a487d32

View file

@ -211,11 +211,7 @@ impl EventHandler for MPDDisplay {
} }
fn text_input_event(&mut self, _ctx: &mut Context, character: char) { fn text_input_event(&mut self, _ctx: &mut Context, character: char) {
if !self.is_initialized if !self.is_initialized && self.opts.enable_prompt_password && !character.is_control() {
&& self.opts.enable_prompt_password
&& character.is_ascii()
&& !character.is_ascii_control()
{
if self.opts.password.is_none() { if self.opts.password.is_none() {
let s = String::from(character); let s = String::from(character);
self.opts.password = Some(s); self.opts.password = Some(s);