cedric pushed a commit to branch master.


commit 569cb23fc1814e6e358f1b5d1d11173012142373
Author: woochan lee <wc0917....@samsung.com>
Date:   Wed Jul 29 22:17:34 2015 +0200

    spinner: entry text makes to registered special value instead of number.
    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.
    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 <ced...@osg.samsung.com>
 src/lib/elm_spinner.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 42ff096..46e884c 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -53,8 +53,18 @@ static void _access_increment_decrement_info_say(Evas_Object 
 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
@@ -91,6 +101,8 @@ _entry_show(Elm_Spinner_Data *sd)
    snprintf(buf, sizeof(buf), fmt, sd->val);
    elm_object_text_set(sd->ent, buf);


Reply via email to