elm gen*: Changed local variable 'no_highlight' -> 'highlight' correctly.
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 8 Mar 2012 10:58:32 +0000 (10:58 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 8 Mar 2012 10:58:32 +0000 (10:58 +0000)
Signed-off-by: Daniel Juyung Seo <juyung.seo@samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69050 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_gen_common.h
src/lib/elm_gengrid.c
src/lib/elm_genlist.c

index f885a3b..7819084 100644 (file)
@@ -98,7 +98,7 @@ struct _Widget_Data
    Eina_Bool                      on_hold : 1;
    Eina_Bool                      multi : 1; /**< a flag for item multi selection */
    Eina_Bool                      wasselected : 1;
-   Eina_Bool                      no_highlight : 1;
+   Eina_Bool                      highlight : 1; /**< a flag for items can be highlighted or not. by default this flag is true. */
    Eina_Bool                      clear_me : 1; /**< a flag whether genlist is marked as to be cleared or not. if this flag is true, genlist clear was already deferred.  */
    Eina_Bool                      h_bounce : 1;
    Eina_Bool                      v_bounce : 1;
index 082d94f..c48d29e 100644 (file)
@@ -872,7 +872,7 @@ static void
 _item_highlight(Elm_Gen_Item *it)
 {
    if ((it->wd->select_mode == ELM_OBJECT_SELECT_MODE_NONE) ||
-       (it->wd->no_highlight) || (it->highlighted) ||
+       (!it->wd->highlight) || (it->highlighted) ||
        (it->generation < it->wd->generation)) return;
    edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
    it->highlighted = EINA_TRUE;
@@ -1946,6 +1946,7 @@ elm_gengrid_add(Evas_Object *parent)
    wd->align_y = 0.5;
    wd->h_bounce = bounce;
    wd->v_bounce = bounce;
+   wd->highlight = EINA_TRUE;
 
    evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
    evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
index 5850bee..d3651d9 100644 (file)
@@ -688,7 +688,7 @@ _item_highlight(Elm_Gen_Item *it)
 {
    const char *selectraise;
    if ((it->wd->select_mode == ELM_OBJECT_SELECT_MODE_NONE) ||
-       (it->wd->no_highlight) ||
+       (!it->wd->highlight) ||
        (it->generation < it->wd->generation) ||
        (it->highlighted) || elm_widget_item_disabled_get(it) ||
        (it->select_mode == ELM_OBJECT_SELECT_MODE_NONE) || (it->item->mode_view) ||
@@ -3479,6 +3479,7 @@ elm_genlist_add(Evas_Object *parent)
    wd->max_items_per_block = MAX_ITEMS_PER_BLOCK;
    wd->item_cache_max = wd->max_items_per_block * 2;
    wd->longpress_timeout = _elm_config->longpress_timeout;
+   wd->highlight = EINA_TRUE;
 
    evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
    evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
@@ -5708,8 +5709,7 @@ elm_genlist_highlight_mode_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   highlight = !!highlight;
-   wd->no_highlight = !highlight;
+   wd->highlight = !!highlight;
 }
 
 EAPI Eina_Bool
@@ -5718,7 +5718,7 @@ elm_genlist_highlight_mode_get(const Evas_Object *obj)
    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return EINA_FALSE;
-   return !wd->no_highlight;
+   return wd->highlight;
 }
 
 EAPI void