E entry: Fix password mode toggle.
It's just a straightforward fix. Some cleanup is needed there to make everything nicer, but that's not important for the time being as it'll be replaced with elm_entry "soon" anyway. SVN revision: 79750
This commit is contained in:
parent
38991ff618
commit
cf7f76c329
|
@ -192,6 +192,7 @@ EAPI void
|
|||
e_entry_password_set(Evas_Object *entry, int password_mode)
|
||||
{
|
||||
E_Entry_Smart_Data *sd;
|
||||
char *text;
|
||||
|
||||
if (evas_object_smart_smart_get(entry) != _e_entry_smart) SMARTERRNR();
|
||||
if ((!entry) || (!(sd = evas_object_smart_data_get(entry))))
|
||||
|
@ -199,11 +200,28 @@ e_entry_password_set(Evas_Object *entry, int password_mode)
|
|||
if (sd->password_mode == password_mode)
|
||||
return;
|
||||
|
||||
text = strdup(edje_object_part_text_get(sd->entry_object, ENTRY_PART_NAME));
|
||||
|
||||
sd->password_mode = !!password_mode;
|
||||
if (!sd->password_mode)
|
||||
e_theme_edje_object_set(sd->entry_object, "base/theme/widgets", "e/widgets/entry/text");
|
||||
else
|
||||
e_theme_edje_object_set(sd->entry_object, "base/theme/widgets", "e/widgets/entry/password");
|
||||
|
||||
/* Set the text back. */
|
||||
if (text)
|
||||
{
|
||||
edje_object_part_text_set(sd->entry_object, ENTRY_PART_NAME, text);
|
||||
free(text);
|
||||
}
|
||||
|
||||
/* FIXME: Some sort of an hack to fix focus. We should just have an "update
|
||||
* state" function that handles theme changes. */
|
||||
if (sd->focused)
|
||||
{
|
||||
sd->focused = EINA_FALSE;
|
||||
e_entry_focus(entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue