[Index] implement style_set API for index item 69/77669/11
authorSungtaek Hong <sth253.hong@samsung.com>
Thu, 30 Jun 2016 11:52:26 +0000 (20:52 +0900)
committerSungtaek Hong <sth253.hong@samsung.com>
Wed, 6 Jul 2016 05:33:09 +0000 (22:33 -0700)
Change-Id: Idbdfecdcbf866b56366cb47308246dc02d6905a0
Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>
src/lib/elm_index.c
src/lib/elm_index_item.eo
src/lib/elm_widget_index.h

index e0dfa0b..dd2b78d 100644 (file)
@@ -142,6 +142,24 @@ _elm_index_item_elm_widget_item_access_register(Eo *eo_item, Elm_Index_Item_Data
    return ret;
 }
 
+// TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
+EOLIAN static void
+_elm_index_item_elm_widget_item_style_set(Eo *eo_it EINA_UNUSED,
+                                          Elm_Index_Item_Data *it,
+                                          const char *style)
+{
+   if (eina_stringshare_replace(&it->style, style))
+     elm_widget_theme_object_set(WIDGET(it), VIEW(it), "index", style, elm_widget_style_get(WIDGET(it)));
+}
+
+EOLIAN static const char *
+_elm_index_item_elm_widget_item_style_get(Eo *eo_it EINA_UNUSED,
+                                          Elm_Index_Item_Data *it)
+{
+   return it->style;
+}
+/* END */
+
 static void
 _omit_calc(void *data, int num_of_items, int max_num_of_items)
 {
@@ -347,8 +365,13 @@ _index_box_auto_fill(Evas_Object *obj,
 
         edje_object_mirrored_set(VIEW(it), rtl);
         o = VIEW(it);
-
+        /* TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
         if (sd->horizontal)
+        */
+        if (it->style)
+          elm_widget_theme_object_set(obj, o, "index", it->style, elm_widget_style_get(obj));
+        else if (sd->horizontal)
+        /* END */
           {
              if (i & 0x1)
                elm_widget_theme_object_set
index 7380e85..d33af84 100644 (file)
@@ -46,5 +46,9 @@ class Elm.Index_Item(Elm.Widget_Item, Elm_Interface_Atspi_Widget_Action)
         Elm_Interface_Atspi_Accessible.name.get;
         Elm_Interface_Atspi_Widget_Action.elm_actions.get;
         ///
+        // TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
+        Elm.Widget_Item.style.get;
+        Elm.Widget_Item.style.set;
+        /* END */
    }
 }
index f48330d..c08efa6 100644 (file)
@@ -63,6 +63,9 @@ struct _Elm_Index_Item_Data
    Elm_Index_Item_Data  *head;
 
    int              priority;
+   // TIZEN_ONLY(20160630): implement elm_index_item_elm_widget_item_style_set
+   Eina_Stringshare *style;
+   /* END */
    Eina_Bool        selected : 1; /**< a flag that remembers an item is selected. this is set true when mouse down/move occur above an item and when elm_index_item_selected_set() API is called. */
 };