[clutter] settings: Add password-hint-time property



commit 07912a147dffca9cfdeb84a77e6edf567743cb20
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Mon Sep 19 16:43:05 2011 +0100

    settings: Add password-hint-time property
    
    Add a setting that controls whether ClutterText actors in password mode
    should display the last input character for a defined time. This helps
    on touch-based interfaces.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652588

 clutter/clutter-settings.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-settings.c b/clutter/clutter-settings.c
index 403fbea..e6187b9 100644
--- a/clutter/clutter-settings.c
+++ b/clutter/clutter-settings.c
@@ -69,6 +69,8 @@ struct _ClutterSettings
   gint long_press_duration;
 
   guint last_fontconfig_timestamp;
+
+  guint password_hint_time;
 };
 
 struct _ClutterSettingsClass
@@ -99,6 +101,8 @@ enum
 
   PROP_FONTCONFIG_TIMESTAMP,
 
+  PROP_PASSWORD_HINT_TIME,
+
   PROP_LAST
 };
 
@@ -304,6 +308,10 @@ clutter_settings_set_property (GObject      *gobject,
       settings_update_fontmap (self, g_value_get_uint (value));
       break;
 
+    case PROP_PASSWORD_HINT_TIME:
+      self->password_hint_time = g_value_get_uint (value);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
       break;
@@ -360,6 +368,10 @@ clutter_settings_get_property (GObject    *gobject,
       g_value_set_int (value, self->long_press_duration);
       break;
 
+    case PROP_PASSWORD_HINT_TIME:
+      g_value_set_uint (value, self->password_hint_time);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
       break;
@@ -584,6 +596,24 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
                        0,
                        CLUTTER_PARAM_WRITABLE);
 
+  /**
+   * ClutterText:password-hint-time:
+   *
+   * How long should Clutter show the last input character in editable
+   * ClutterText actors. The value is in milliseconds. A value of 0
+   * disables showing the password hint. 600 is a good value for
+   * enabling the hint.
+   *
+   * Since: 1.10
+   */
+  obj_props[PROP_PASSWORD_HINT_TIME] =
+    g_param_spec_uint ("password-hint-time",
+                       P_("Password Hint Time"),
+                       P_("THow low to show the last input character in hidden entries"),
+                       0, G_MAXUINT,
+                       0,
+                       CLUTTER_PARAM_READWRITE);
+
   gobject_class->set_property = clutter_settings_set_property;
   gobject_class->get_property = clutter_settings_get_property;
   gobject_class->dispatch_properties_changed =



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