lib/app & linux: intro `TextInput::is_password`
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 25 Nov 2015 21:18:14 +0000 (16:18 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 3 Mar 2016 19:13:18 +0000 (14:13 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/app/ui.nit
lib/linux/ui.nit

index 3a6af1e..c23d9cd 100644 (file)
@@ -163,6 +163,9 @@ end
 # A control for the user to enter custom `text`
 class TextInput
        super TextView
+
+       # Hide password or any content entered in this view?
+       var is_password: nullable Bool is writable
 end
 
 # A pushable button, raises `ButtonPressEvent`
index 21dc181..049486f 100644 (file)
@@ -158,4 +158,10 @@ redef class TextInput
                if value == null then value = ""
                native.text = value.to_s
        end
+
+       redef fun is_password=(value)
+       do
+               native.visibility = value != true
+               super
+       end
 end