hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=b4655c371c25b1b23c694b27475f0b9edf162d07

commit b4655c371c25b1b23c694b27475f0b9edf162d07
Author: Hermet Park <[email protected]>
Date:   Fri Aug 12 15:09:07 2016 +0900

    text_setting: reset font style properly.
---
 src/bin/text_setting.c | 38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/src/bin/text_setting.c b/src/bin/text_setting.c
index f4c8724..324f48c 100644
--- a/src/bin/text_setting.c
+++ b/src/bin/text_setting.c
@@ -842,17 +842,39 @@ text_setting_font_set(text_setting_data *tsd, const char 
*font_name,
 
    if (!tsd->list_font_name) return;
 
-   const Eina_List *it_list = elm_list_items_get(tsd->list_font_name);
-   const Eina_List *l;
-   Elm_Object_Item *it;
+   //Reset font name
+   if (font_name)
+     {
+        const Eina_List *it_list = elm_list_items_get(tsd->list_font_name);
+        const Eina_List *l;
+        Elm_Object_Item *it;
 
-   EINA_LIST_FOREACH(it_list, l, it)
+        EINA_LIST_FOREACH(it_list, l, it)
+          {
+             const char *name = elm_object_item_text_get(it);
+             if (!strcmp(font_name, name))
+               {
+                  elm_list_item_selected_set(it, EINA_TRUE);
+                  break;
+               }
+          }
+     }
+
+   //Reset font style
+   if (font_style)
      {
-        const char *name = elm_object_item_text_get(it);
-        if (font_name && !strcmp(font_name, name))
+        const Eina_List *it_list = elm_list_items_get(tsd->list_font_style);
+        const Eina_List *l;
+        Elm_Object_Item *it;
+
+        EINA_LIST_FOREACH(it_list, l, it)
           {
-             elm_list_item_selected_set(it, EINA_TRUE);
-             break;
+             const char *name = elm_object_item_text_get(it);
+             if (!strcmp(font_style, name))
+               {
+                  elm_list_item_selected_set(it, EINA_TRUE);
+                  break;
+               }
           }
      }
 }

-- 


Reply via email to