summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorchanwook jung <jchanwook@gmail.com>2012-03-23 07:47:03 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-03-23 07:47:03 +0000
commita0ce8512b71fd072b3525c18f6cadc82c30e7694 (patch)
tree6f6b1b77f9047bf80b9ce88762216da7d66e8edf /legacy/elementary
parent20f3049d40d373827452094fdc6c420728ae0adb (diff)
From: chanwook jung <jchanwook@gmail.com>
Subject: [E-devel] [Patch][Genlist] Tree effect bug fix I found some bugs in tree effect. flickering, emit signal to unrealize item... so I fix it. SVN revision: 69582
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elm_genlist.c83
1 files changed, 50 insertions, 33 deletions
diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c
index 69a2621397..3aa5ad6909 100644
--- a/legacy/elementary/src/lib/elm_genlist.c
+++ b/legacy/elementary/src/lib/elm_genlist.c
@@ -77,6 +77,7 @@ struct Elm_Gen_Item_Type
77 Eina_Bool move_effect_enabled : 1; 77 Eina_Bool move_effect_enabled : 1;
78 Eina_Bool decorate_mode_item_realized : 1; 78 Eina_Bool decorate_mode_item_realized : 1;
79 Eina_Bool tree_effect_finished : 1; /* tree effect */ 79 Eina_Bool tree_effect_finished : 1; /* tree effect */
80 Eina_Bool tree_effect_hideme : 1; /* item hide for tree effect */
80}; 81};
81 82
82struct _Item_Block 83struct _Item_Block
@@ -2179,7 +2180,15 @@ _item_realize(Elm_Gen_Item *it,
2179 //evas_event_thaw(evas_object_evas_get(it->wd->obj)); 2180 //evas_event_thaw(evas_object_evas_get(it->wd->obj));
2180 //evas_event_thaw_eval(evas_object_evas_get(it->wd->obj)); 2181 //evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
2181 if (!calc) 2182 if (!calc)
2182 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it); 2183 {
2184 if (it->item->tree_effect_hideme)
2185 {
2186 if (it->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE)
2187 edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
2188 it->item->tree_effect_hideme = EINA_FALSE;
2189 }
2190 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
2191 }
2183 2192
2184 if ((!calc) && (it->wd->decorate_mode) && (it->item->type != ELM_GENLIST_ITEM_GROUP)) 2193 if ((!calc) && (it->wd->decorate_mode) && (it->item->type != ELM_GENLIST_ITEM_GROUP))
2185 { 2194 {
@@ -2485,13 +2494,19 @@ _item_block_position(Item_Block *itb,
2485 it->item->scrl_y); 2494 it->item->scrl_y);
2486 else 2495 else
2487 { 2496 {
2488 if (it->item->mode_view) 2497 if (!it->wd->tree_effect_enabled ||
2489 _item_position(it, it->item->mode_view, 2498 (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE) ||
2490 it->item->scrl_x, 2499 ((it->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE) &&
2491 it->item->scrl_y); 2500 (it->item->old_scrl_y == it->item->scrl_y)))
2492 else 2501 {
2493 _item_position(it, VIEW(it), it->item->scrl_x, 2502 if (it->item->mode_view)
2494 it->item->scrl_y); 2503 _item_position(it, it->item->mode_view,
2504 it->item->scrl_x,
2505 it->item->scrl_y);
2506 else
2507 _item_position(it, VIEW(it), it->item->scrl_x,
2508 it->item->scrl_y);
2509 }
2495 } 2510 }
2496 it->item->old_scrl_y = it->item->scrl_y; 2511 it->item->old_scrl_y = it->item->scrl_y;
2497 } 2512 }
@@ -2994,6 +3009,19 @@ _pan_calculate(Evas_Object *obj)
2994 { 3009 {
2995 git->item->want_realize = EINA_FALSE; 3010 git->item->want_realize = EINA_FALSE;
2996 } 3011 }
3012
3013 if (sd->wd->tree_effect_enabled && (sd->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE))
3014 {
3015 if (!sd->wd->tree_effect_animator)
3016 {
3017 _item_tree_effect_before(sd->wd->expanded_item);
3018 evas_object_raise(sd->wd->alpha_bg);
3019 evas_object_show(sd->wd->alpha_bg);
3020 sd->wd->start_time = ecore_time_get();
3021 sd->wd->tree_effect_animator = ecore_animator_add(_tree_effect_animator_cb, sd->wd);
3022 }
3023 }
3024
2997 EINA_INLIST_FOREACH(sd->wd->blocks, itb) 3025 EINA_INLIST_FOREACH(sd->wd->blocks, itb)
2998 { 3026 {
2999 itb->w = sd->wd->minw; 3027 itb->w = sd->wd->minw;
@@ -3024,18 +3052,7 @@ _pan_calculate(Evas_Object *obj)
3024 sd->wd->start_time = ecore_loop_time_get(); 3052 sd->wd->start_time = ecore_loop_time_get();
3025 } 3053 }
3026 3054
3027 if (sd->wd->tree_effect_enabled && (sd->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE)) 3055 if (!sd->wd->tree_effect_enabled || (sd->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE))
3028 {
3029 if (!sd->wd->tree_effect_animator)
3030 {
3031 _item_tree_effect_before(sd->wd->expanded_item);
3032 evas_object_raise(sd->wd->alpha_bg);
3033 evas_object_show(sd->wd->alpha_bg);
3034 sd->wd->start_time = ecore_time_get();
3035 sd->wd->tree_effect_animator = ecore_animator_add(_tree_effect_animator_cb, sd->wd);
3036 }
3037 }
3038 else
3039 _item_auto_scroll(sd->wd); 3056 _item_auto_scroll(sd->wd);
3040 3057
3041 evas_event_thaw(evas_object_evas_get(obj)); 3058 evas_event_thaw(evas_object_evas_get(obj));
@@ -5872,6 +5889,8 @@ _item_tree_effect_before(Elm_Gen_Item *it)
5872 { 5889 {
5873 if (it2->parent && (it == it2->parent)) 5890 if (it2->parent && (it == it2->parent))
5874 { 5891 {
5892 if (!it2->realized)
5893 it2->item->tree_effect_hideme = EINA_TRUE;
5875 if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND) 5894 if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
5876 edje_object_signal_emit(VIEW(it2), "elm,state,hide", ""); 5895 edje_object_signal_emit(VIEW(it2), "elm,state,hide", "");
5877 else if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT) 5896 else if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
@@ -5894,13 +5913,13 @@ _item_tree_effect(Widget_Data *wd, int y)
5894 while (it) 5913 while (it)
5895 { 5914 {
5896 if (it->item->expanded_depth <= expanded_next_it->item->expanded_depth) break; 5915 if (it->item->expanded_depth <= expanded_next_it->item->expanded_depth) break;
5897 if (it->item->scrl_y && (it->item->scrl_y < expanded_next_it->item->old_scrl_y + y) && 5916 if (it->item->scrl_y && (it->item->scrl_y <= expanded_next_it->item->old_scrl_y + y) &&
5898 (it->item->expanded_depth > expanded_next_it->item->expanded_depth)) 5917 (it->item->expanded_depth > expanded_next_it->item->expanded_depth))
5899 { 5918 {
5900 if (!it->item->tree_effect_finished) 5919 if (!it->item->tree_effect_finished)
5901 { 5920 {
5902 edje_object_signal_emit(VIEW(it), "flip_item", ""); 5921 edje_object_signal_emit(VIEW(it), "flip_item", "");
5903 evas_object_show(VIEW(it)); 5922 _item_position(it, VIEW(it), it->item->scrl_x, it->item->scrl_y);
5904 it->item->tree_effect_finished = EINA_TRUE; 5923 it->item->tree_effect_finished = EINA_TRUE;
5905 } 5924 }
5906 } 5925 }
@@ -5931,7 +5950,6 @@ _item_tree_effect(Widget_Data *wd, int y)
5931static void 5950static void
5932_item_tree_effect_finish(Widget_Data *wd) 5951_item_tree_effect_finish(Widget_Data *wd)
5933{ 5952{
5934 Item_Block *itb;
5935 Elm_Gen_Item *it = NULL; 5953 Elm_Gen_Item *it = NULL;
5936 const Eina_List *l; 5954 const Eina_List *l;
5937 5955
@@ -5939,13 +5957,12 @@ _item_tree_effect_finish(Widget_Data *wd)
5939 { 5957 {
5940 if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT) 5958 if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
5941 _item_subitems_clear(wd->expanded_item); 5959 _item_subitems_clear(wd->expanded_item);
5942 EINA_INLIST_FOREACH(wd->blocks, itb) 5960 EINA_LIST_FOREACH(wd->expanded_item->item->items, l, it)
5943 { 5961 {
5944 EINA_LIST_FOREACH(itb->items, l, it) 5962 it->item->tree_effect_finished = EINA_TRUE;
5945 { 5963 it->item->old_scrl_y = it->item->scrl_y;
5946 it->item->tree_effect_finished = EINA_TRUE; 5964 if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
5947 it->item->old_scrl_y = it->item->scrl_y; 5965 edje_object_signal_emit(VIEW(it), "elm,state,show", "");
5948 }
5949 } 5966 }
5950 } 5967 }
5951 _item_auto_scroll(wd); 5968 _item_auto_scroll(wd);
@@ -5969,7 +5986,7 @@ _tree_effect_animator_cb(void *data)
5969 Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh; 5986 Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
5970 Elm_Gen_Item *it = NULL, *it2, *expanded_next_it; 5987 Elm_Gen_Item *it = NULL, *it2, *expanded_next_it;
5971 const Eina_List *l; 5988 const Eina_List *l;
5972 double effect_duration = 0.5, t; 5989 double effect_duration = 0.3, t;
5973 int y = 0, dy = 0, dh = 0; 5990 int y = 0, dy = 0, dh = 0;
5974 Eina_Bool end = EINA_FALSE, vis = EINA_TRUE; 5991 Eina_Bool end = EINA_FALSE, vis = EINA_TRUE;
5975 int in = 0; 5992 int in = 0;
@@ -5999,7 +6016,7 @@ _tree_effect_animator_cb(void *data)
5999 if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND) 6016 if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
6000 { 6017 {
6001 expanded_next_it->item->old_scrl_y = wd->expanded_item->item->old_scrl_y + wd->expanded_item->item->h; 6018 expanded_next_it->item->old_scrl_y = wd->expanded_item->item->old_scrl_y + wd->expanded_item->item->h;
6002 if (expanded_next_it->item->scrl_y < expanded_next_it->item->old_scrl_y) //did not calculate next item position 6019 if (expanded_next_it->item->scrl_y <= expanded_next_it->item->old_scrl_y) //did not calculate next item position
6003 expanded_next_it->item->scrl_y = cvy + cvh; 6020 expanded_next_it->item->scrl_y = cvy + cvh;
6004 6021
6005 dy = ((expanded_next_it->item->scrl_y >= (cvy + cvh)) ? 6022 dy = ((expanded_next_it->item->scrl_y >= (cvy + cvh)) ?
@@ -6008,7 +6025,7 @@ _tree_effect_animator_cb(void *data)
6008 } 6025 }
6009 else if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT) 6026 else if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
6010 { 6027 {
6011 if (expanded_next_it->item->scrl_y > expanded_next_it->item->old_scrl_y) //did not calculate next item position 6028 if (expanded_next_it->item->scrl_y >= expanded_next_it->item->old_scrl_y) //did not calculate next item position
6012 expanded_next_it->item->old_scrl_y = cvy + cvh; 6029 expanded_next_it->item->old_scrl_y = cvy + cvh;
6013 6030
6014 if (expanded_next_it->item->old_scrl_y > (cvy + cvh)) 6031 if (expanded_next_it->item->old_scrl_y > (cvy + cvh))
@@ -6078,7 +6095,7 @@ _tree_effect_animator_cb(void *data)
6078 if (t >= (((num - 1) * effect_duration) / expanded_item_num)) 6095 if (t >= (((num - 1) * effect_duration) / expanded_item_num))
6079 { 6096 {
6080 edje_object_signal_emit(VIEW(it), "flip_item", ""); 6097 edje_object_signal_emit(VIEW(it), "flip_item", "");
6081 evas_object_show(VIEW(it)); 6098 _item_position(it, VIEW(it), it->item->scrl_x, it->item->scrl_y);
6082 it->item->tree_effect_finished = EINA_TRUE; 6099 it->item->tree_effect_finished = EINA_TRUE;
6083 } 6100 }
6084 } 6101 }