[clutter] cally: Use the proper role for password entries



commit d596401a3c1f88d396c06702ed488328ff4d1bd8
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Nov 4 07:14:47 2011 -0400

    cally: Use the proper role for password entries
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663332

 clutter/cally/cally-text.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/clutter/cally/cally-text.c b/clutter/cally/cally-text.c
index 1c7c686..b601d13 100644
--- a/clutter/cally/cally-text.c
+++ b/clutter/cally/cally-text.c
@@ -344,7 +344,10 @@ cally_text_real_initialize(AtkObject *obj,
 
   _check_activate_action (cally_text, clutter_text);
 
-  obj->role = ATK_ROLE_TEXT;
+  if (clutter_text_get_password_char (clutter_text) != 0)
+    obj->role = ATK_ROLE_PASSWORD_TEXT;
+  else
+    obj->role = ATK_ROLE_TEXT;
 }
 
 static const gchar *
@@ -1091,6 +1094,13 @@ cally_text_notify_clutter (GObject    *obj,
     {
       _check_activate_action (cally_text, clutter_text);
     }
+  else if (g_strcmp0 (pspec->name, "password-char") == 0)
+    {
+      if (clutter_text_get_password_char (clutter_text) != 0)
+        atk_object_set_role (atk_obj, ATK_ROLE_PASSWORD_TEXT);
+      else
+        atk_object_set_role (atk_obj, ATK_ROLE_TEXT);
+    }
   else
     {
       CALLY_ACTOR_CLASS (cally_text_parent_class)->notify_clutter (obj, pspec);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]