Use secure input so visibility of password can be toggled
This commit is contained in:
parent
501d7b19d0
commit
75e456ed4b
1 changed files with 12 additions and 9 deletions
|
|
@ -659,12 +659,15 @@ impl cosmic::Application for App {
|
|||
match &self.prompt_opt {
|
||||
Some((prompt, secret, value_opt)) => match value_opt {
|
||||
Some(value) => {
|
||||
let mut text_input = widget::text_input(prompt.clone(), value.clone())
|
||||
.leading_icon(
|
||||
widget::icon::from_name("system-lock-screen-symbolic").into(),
|
||||
)
|
||||
.trailing_icon(
|
||||
widget::icon::from_name("document-properties-symbolic").into(),
|
||||
let mut text_input = widget::secure_input(
|
||||
prompt.clone(),
|
||||
value.clone(),
|
||||
Some(Message::Prompt(
|
||||
prompt.clone(),
|
||||
!*secret,
|
||||
Some(value.clone()),
|
||||
)),
|
||||
*secret,
|
||||
)
|
||||
.on_input(|value| Message::Prompt(prompt.clone(), *secret, Some(value)))
|
||||
.on_submit(Message::Submit);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue