Summary:
Entry has only number text when activated and value changed, Even user registered special value to each spinner value.
If the user registered special value, we should check then showing the special value instead of number text.
Its will more helpful to expect the result when user set a spinner value using spinner entry.
@fix
Test Plan:
There is a spinner sample in elementary_test.
Changing editable value as TRUE for the last spinner object.
Click the spinner to activated entry and check the result.
Reviewers: Hermet, Jaehyun, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2844
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
static void
_entry_show(Elm_Spinner_Data *sd)
{
+ Eina_List *l;
+ Elm_Spinner_Special_Value *sv;
char buf[32], fmt[32] = "%0.f";
+ EINA_LIST_FOREACH(sd->special_values, l, sv)
+ {
+ if (sv->value == sd->val)
+ {
+ snprintf(buf, sizeof(buf), "%s", sv->label);
+ goto apply;
+ }
+ }
/* try to construct just the format from given label
* completely ignoring pre/post words
*/
}
}
snprintf(buf, sizeof(buf), fmt, sd->val);
+
+apply:
elm_object_text_set(sd->ent, buf);
}