cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=257607cc69abae7de92810c9a8ee64610be1c905

commit 257607cc69abae7de92810c9a8ee64610be1c905
Author: Amitesh Singh <[email protected]>
Date:   Mon Mar 3 09:29:34 2014 -0300

    edje: add support of last input entered in password mode to be always 
visible in entry.
    
    @feature
    
    Requirement: Last input entered in password mode should be always visible in
    entry. e.g. **a -> ***b.
    
    Reviewers: cedric, raster, seoz
    
    Reviewed By: cedric
    
    CC: cedric
    
    Differential Revision: https://phab.enlightenment.org/D589
    
    Signed-off-by: Cedric Bail <[email protected]>
---
 src/lib/edje/Edje_Common.h |  2 +-
 src/lib/edje/edje_entry.c  | 15 +++++++++------
 src/lib/edje/edje_util.c   |  6 +++---
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index 7180fac..e3000e5 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -1039,7 +1039,7 @@ EAPI void edje_password_show_last_set(Eina_Bool 
password_show_last);
  * @param password_show_last_timeout The timeout value.
  *
  * This functions sets the time out value for which the last input entered in 
password
- * mode will be visible.
+ * mode will be visible. If the time out value is less than zero, the last 
input entered in password mode will be always visible.
  *
  * This value can be used only when last show mode is set in password mode.
  *
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index a4b1742..ee191c8 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -1856,8 +1856,9 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED,
                             ecore_timer_del(en->pw_timer);
                             en->pw_timer = NULL;
                          }
-                       en->pw_timer = ecore_timer_add
-                         (TO_DOUBLE(_edje_password_show_last_timeout),
+                       if (_edje_password_show_last_timeout >= 0)
+                         en->pw_timer = ecore_timer_add
+                           (_edje_password_show_last_timeout,
                              _password_timer_cb, en);
                     }
                }
@@ -4013,8 +4014,9 @@ _edje_entry_imf_event_commit_cb(void *data, 
Ecore_IMF_Context *ctx EINA_UNUSED,
                   ecore_timer_del(en->pw_timer);
                   en->pw_timer = NULL;
                }
-             en->pw_timer = ecore_timer_add
-               (TO_DOUBLE(_edje_password_show_last_timeout),
+             if (_edje_password_show_last_timeout >= 0)
+               en->pw_timer = ecore_timer_add
+                 (_edje_password_show_last_timeout,
                    _password_timer_cb, en);
           }
      }
@@ -4140,8 +4142,9 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, 
Ecore_IMF_Context *ctx EINA
                        ecore_timer_del(en->pw_timer);
                        en->pw_timer = NULL;
                     }
-                  en->pw_timer = ecore_timer_add
-                    (TO_DOUBLE(_edje_password_show_last_timeout),
+                  if (_edje_password_show_last_timeout >= 0)
+                    en->pw_timer = ecore_timer_add
+                      (_edje_password_show_last_timeout,
                         _password_timer_cb, en);
                   free(info);
                }
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 8eb743e..7f02804 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -23,7 +23,7 @@ static Eina_Rbtree *_edje_box_layout_registry = NULL;
 char *_edje_fontset_append = NULL;
 FLOAT_T _edje_scale = ZERO;
 Eina_Bool _edje_password_show_last = EINA_FALSE;
-FLOAT_T _edje_password_show_last_timeout = ZERO;
+double _edje_password_show_last_timeout = 0;
 int _edje_freeze_val = 0;
 int _edje_freeze_calc_count = 0;
 Eina_List *_edje_freeze_calc_list = NULL;
@@ -344,8 +344,8 @@ edje_password_show_last_set(Eina_Bool password_show_last)
 EAPI void
 edje_password_show_last_timeout_set(double password_show_last_timeout)
 {
-   if (_edje_password_show_last_timeout == 
FROM_DOUBLE(password_show_last_timeout)) return;
-   _edje_password_show_last_timeout = FROM_DOUBLE(password_show_last_timeout);
+   if (_edje_password_show_last_timeout == password_show_last_timeout) return;
+   _edje_password_show_last_timeout = password_show_last_timeout;
 }
 
 EAPI Eina_Bool

-- 


Reply via email to