From: David Aguilar Date: Sat, 7 Nov 2020 22:20:39 +0000 (-0800) Subject: git-gui: ssh-askpass: add a checkbox to show the input text X-Git-Tag: v2.30.0-rc1~9^2~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4e1bc99713355b8b11cdd8ae691aa05f063b351;p=thirdparty%2Fgit.git git-gui: ssh-askpass: add a checkbox to show the input text Hide the input text by default since the field is commonly used for sensative informations such as passwords. Add a "Show input" checkbox to conditionally show the input. Helped-by: Miguel Boekhold Signed-off-by: Efimov Vasily Signed-off-by: David Aguilar Signed-off-by: Pratyush Yadav --- diff --git a/git-gui--askpass b/git-gui--askpass index 1c99ee8ca2..71a536d232 100755 --- a/git-gui--askpass +++ b/git-gui--askpass @@ -26,8 +26,21 @@ pack .m -side top -fill x -padx 20 -pady 20 -expand 1 entry .e -textvariable answer -width 50 pack .e -side top -fill x -padx 10 -pady 10 +proc on_show_input_changed {args} { + global show_input + if {$show_input} { + .e configure -show "" + } else { + .e configure -show "*" + } +} +trace add variable show_input write "on_show_input_changed" + +set show_input 0 + if {!$yesno} { - .e configure -show "*" + checkbutton .cb_show -text "Show input" -variable show_input + pack .cb_show -side top -anchor nw } frame .b