[EGIT] [core/elementary] master 07/11: Genlist: fix for an item width calculation issue on item show / scrolling
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=6785fa01252f0b789d6c93ee6f52afcda4a3aa7a commit 6785fa01252f0b789d6c93ee6f52afcda4a3aa7a Author: godly.talias Date: Fri Mar 4 15:46:18 2016 -0800 Genlist: fix for an item width calculation issue on item show / scrolling Summary: When item_show / scrolling is happening, _item_block_position will be called from smart_calculate where item width is set as block width. If items are not realized _item_realize will be called and if items are getting realized for first time we set mincalcd as false. So later item width gets overwritten by min width of item and so issue is happening. @fix T2603 Signed-off-by: godly.talias Test Plan: elementary_test -> Genlist Group -> show 480 Reviewers: prince.dubey, shilpasingh, SanghyeonLee, cedric Subscribers: rajeshps, seoz, govi Maniphest Tasks: T2603 Differential Revision: https://phab.enlightenment.org/D3729 Signed-off-by: Cedric BAIL --- src/lib/elm_genlist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index ebb31f2..fd5e8aa 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -1900,6 +1900,8 @@ _item_realize(Elm_Gen_Item *it, GL_IT(it)->w = GL_IT(it)->minw = size->minw; GL_IT(it)->h = GL_IT(it)->minh = size->minh; it->item->mincalcd = EINA_TRUE; + if (GL_IT(it)->block->realized) +GL_IT(it)->w = GL_IT(it)->block->w; } else { --
[EGIT] [core/elementary] master 01/01: [Hover] Fixed the delaying of hover dismiss on continuous mouse clicks
raster pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=17553e2a3572d943ebe1a0aa72eba8ec29add857 commit 17553e2a3572d943ebe1a0aa72eba8ec29add857 Author: godly.talias Date: Wed Jan 13 15:59:15 2016 +0900 [Hover] Fixed the delaying of hover dismiss on continuous mouse clicks Summary: When continous mouse clicks happen hover emits the hide signals continously to edje. As the embryo program for hiding requires some time to finish the animation, if within that time another mouse click comes the program gets invoked again and thus the hiding will get delayed till the mouse clicks ends. This patch fix that issue by adding a flag for emitting signals. @fix T3006 Signed-off-by: godly.talias Test Plan: elementary_test Reviewers: cedric, conr2d, prince.dubey, shilpasingh, Princekrdubey Reviewed By: shilpasingh, Princekrdubey Subscribers: Princekrdubey, divyesh, govi, rajeshps Maniphest Tasks: T3006 Differential Revision: https://phab.enlightenment.org/D3526 --- data/themes/edc/elm/hover.edc | 58 +-- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/data/themes/edc/elm/hover.edc b/data/themes/edc/elm/hover.edc index 75ea813..cce316a 100644 --- a/data/themes/edc/elm/hover.edc +++ b/data/themes/edc/elm/hover.edc @@ -1,6 +1,9 @@ /* TODO: replicate diagonal swallow slots to the other hover styles */ group { name: "elm/hover/base/default"; data.item: "dismiss" "on"; + script { + public on_dismiss = 0; + } parts { part { name: "elm.swallow.offset"; type: SWALLOW; description { state: "default" 0.0; @@ -130,14 +133,22 @@ group { name: "elm/hover/base/default"; programs { program { name: "end"; signal: "mouse,up,*"; source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" "elm"; + script { +if (get_int(on_dismiss) == 0) { + emit("elm,action,dismiss", "elm"); + set_int(on_dismiss, 1); +} + } } program { name: "hide"; signal: "elm,action,hide"; source: "elm"; after: "hidefinished"; } program { name: "hidefinished"; - action: SIGNAL_EMIT "elm,action,hide,finished" "elm"; + script { +set_int(on_dismiss, 0); +emit("elm,action,hide,finished", "elm"); + } } } } @@ -145,6 +156,9 @@ group { name: "elm/hover/base/default"; group { name: "elm/hover/base/popout"; data.item: "dismiss" "on"; images.image: "button_normal.png" COMP; + script { + public on_dismiss = 0; + } parts { part { name: "elm.swallow.offset"; type: SWALLOW; description { state: "default" 0.0; @@ -361,7 +375,12 @@ group { name: "elm/hover/base/popout"; programs { program { name: "end"; signal: "mouse,up,*"; source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" "elm"; + script { +if (get_int(on_dismiss) == 0) { + emit("elm,action,dismiss", "elm"); + set_int(on_dismiss, 1); +} + } } program { name: "show"; signal: "elm,action,show"; source: "elm"; @@ -376,7 +395,10 @@ group { name: "elm/hover/base/popout"; after: "hidefinished"; } program { name: "hidefinished"; - action: SIGNAL_EMIT "elm,action,hide,finished" "elm"; + script { +set_int(on_dismiss, 0); +emit("elm,action,hide,finished", "elm"); + } } program { name: "leftshow"; signal: "elm,action,slot,left,show"; source: "elm"; @@ -450,6 +472,7 @@ group { name: "elm/hover/base/hoversel_vertical/default"; script { public visible = 0; public right = 0; + public on_dismiss = 0; public topshow2() { if (get_int(right) == 0) run_program(PROGRAM:"topshow_default"); @@ -644,7 +667,12 @@ group { name: "elm/hover/base/hoversel_vertical/default"; programs { program { name: "end"; signal: "mouse,up,*"; source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" "elm"; + script { +if (get_int(on_dismiss) == 0) { + emit("elm,action,dismiss&qu
[EGIT] [core/elementary] master 02/02: hoversel: add item disabling support.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=178fad6d1c0435dfc724a7eea95423e362a7789d commit 178fad6d1c0435dfc724a7eea95423e362a7789d Author: godly.talias Date: Tue Nov 10 15:15:29 2015 -0800 hoversel: add item disabling support. Summary: Hoversel items can be disabled using elm_object_item_disabled_set @feature Test Plan: elementary_test Reviewers: prince.dubey, shilpasingh, raster, Hermet, conr2d, cedric Subscribers: poornima.srinivasan, rajeshps Differential Revision: https://phab.enlightenment.org/D3122 Signed-off-by: Cedric BAIL --- data/themes/edc/elm/button.edc | 5 + src/bin/test_hoversel.c| 2 ++ src/lib/elc_hoversel.c | 11 +++ src/lib/elm_hoversel_item.eo | 1 + 4 files changed, 19 insertions(+) diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc index f560a2a..92b026b 100644 --- a/data/themes/edc/elm/button.edc +++ b/data/themes/edc/elm/button.edc @@ -1197,6 +1197,11 @@ group { name: "elm/button/base/hoversel_vertical_entry/default"; visible: 1; } } + rect { name: "block_events"; + desc { "default"; +color: 0 0 0 0; + } + } rect { name: "event"; desc { "default"; color: 0 0 0 0; diff --git a/src/bin/test_hoversel.c b/src/bin/test_hoversel.c index 3e39ad0..15d4203 100644 --- a/src/bin/test_hoversel.c +++ b/src/bin/test_hoversel.c @@ -171,6 +171,8 @@ test_hoversel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL); elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL); elm_hoversel_item_add(hoversel, "Item 4 - Long Label Here", "close", ELM_ICON_STANDARD, NULL, NULL); + it = elm_hoversel_item_add(hoversel, "Item 5 - Disabled", NULL, ELM_ICON_NONE, NULL, NULL); + elm_object_item_disabled_set(it, EINA_TRUE); evas_object_smart_callback_add(hoversel, "clicked", _hoversel_clicked_cb, NULL); evas_object_smart_callback_add(hoversel, "selected", diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index 9f8ef4f..d45b687 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -96,6 +96,8 @@ _elm_hoversel_elm_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd) ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); elm_object_style_set(VIEW(item), buf); elm_object_text_set(VIEW(item), item->label); +elm_widget_disabled_set + (VIEW(item), eo_do_ret(eo_item, int_ret, elm_wdg_item_disabled_get())); } eina_stringshare_del(style); @@ -457,6 +459,15 @@ _on_parent_del(void *data, elm_hoversel_hover_parent_set(data, NULL); } +EOLIAN static void +_elm_hoversel_item_elm_widget_item_disable(Eo *eo_hoversel_it, + Elm_Hoversel_Item_Data *hoversel_it EINA_UNUSED) +{ + Eina_Bool tmp; + elm_widget_disabled_set + (VIEW(hoversel_it), eo_do_ret(eo_hoversel_it, tmp, elm_wdg_item_disabled_get())); +} + static void _elm_hoversel_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED, Elm_Hoversel_Item_Data *it, diff --git a/src/lib/elm_hoversel_item.eo b/src/lib/elm_hoversel_item.eo index 39d0765..04efc85 100644 --- a/src/lib/elm_hoversel_item.eo +++ b/src/lib/elm_hoversel_item.eo @@ -20,6 +20,7 @@ class Elm.Hoversel_Item(Elm.Widget_Item) implements { Eo.Base.constructor; Eo.Base.destructor; +Elm.Widget_Item.disable; Elm.Widget_Item.signal_emit; Elm.Widget_Item.part_text.set; Elm.Widget_Item.part_text.get; --
[EGIT] [core/elementary] master 01/09: hoversel: do item view creation at the time of item addition.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=58edfd10d7b077382178713699d9c84367d1686c commit 58edfd10d7b077382178713699d9c84367d1686c Author: godly.talias Date: Mon Nov 9 12:18:49 2015 -0800 hoversel: do item view creation at the time of item addition. Summary: Currently hoversel creates the item view when user clicks on hoversel, So it will cause a delay for the hover to come depending on number of items as the items in hover have to be created. If item creation is done during item_add that delay can be avoided and pressed effect also will become smooth (item_add will be taking more time with this change, but it happens only once). If applications prefer memory usage more than execution time, then applications can do item_add in hoversel clicked callback. Test Plan: elementary_test Reviewers: raster, Hermet, conr2d, prince.dubey, shilpasingh, cedric Reviewed By: cedric Subscribers: rajeshps, poornima.srinivasan Differential Revision: https://phab.enlightenment.org/D3058 Signed-off-by: Cedric BAIL --- AUTHORS | 2 +- src/lib/elc_hoversel.c| 105 +- src/lib/elm_widget_hoversel.h | 1 + 3 files changed, 66 insertions(+), 42 deletions(-) diff --git a/AUTHORS b/AUTHORS index eefcd81..1c8b979 100644 --- a/AUTHORS +++ b/AUTHORS @@ -164,5 +164,5 @@ Jee-Yong Um Ji-In Moon Subodh Kumar Kumar Navneet -Godly T Alias +Godly T Alias Shashank Pandey diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index 11e9436..11c85fe 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -60,6 +60,8 @@ EOLIAN static Eina_Bool _elm_hoversel_elm_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd) { Eina_Bool int_ret = EINA_FALSE; + Eina_List *l; + Elm_Object_Item *eo_item; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -81,11 +83,22 @@ _elm_hoversel_elm_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd) eina_stringshare_replace(&(wd->style), style); - eina_stringshare_del(style); - if (sd->hover) elm_widget_mirrored_set(sd->hover, elm_widget_mirrored_get(obj)); + if (sd->horizontal) + snprintf(buf, sizeof(buf), "hoversel_horizontal_entry/%s", style); + else + snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s", style); + + EINA_LIST_FOREACH(sd->items, l, eo_item) + { +ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); +elm_object_style_set(VIEW(item), buf); +elm_object_text_set(VIEW(item), item->label); + } + + eina_stringshare_del(style); elm_hoversel_hover_end(obj); return EINA_TRUE; @@ -346,9 +359,11 @@ _hover_end_finished(void *data, EINA_LIST_FOREACH(sd->items, l, eo_item) { ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); - VIEW(it) = NULL; + elm_box_unpack(sd->bx, VIEW(it)); + evas_object_hide(VIEW(it)); } ELM_SAFE_FREE(sd->hover, evas_object_del); +sd->bx = NULL; sd->scr = NULL; sd->last_location = NULL; @@ -360,7 +375,6 @@ static void _activate(Evas_Object *obj) { Elm_Object_Item *eo_item; - Evas_Object *bt, *bx, *ic; const Eina_List *l; char buf[4096]; @@ -394,49 +408,19 @@ _activate(Evas_Object *obj) elm_hover_target_set(sd->hover, obj); /* hover's content */ - bx = elm_box_add(sd->hover); - elm_box_homogeneous_set(bx, EINA_TRUE); - elm_box_horizontal_set(bx, sd->horizontal); - - if (sd->horizontal) - snprintf(buf, sizeof(buf), "hoversel_horizontal_entry/%s", - elm_widget_style_get(obj)); - else - snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s", - elm_widget_style_get(obj)); + sd->bx = elm_box_add(sd->hover); + elm_box_homogeneous_set(sd->bx, EINA_TRUE); + elm_box_horizontal_set(sd->bx, sd->horizontal); EINA_LIST_FOREACH(sd->items, l, eo_item) { ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); -VIEW(item) = bt = elm_button_add(bx); -elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj)); -elm_object_style_set(bt, buf); -elm_object_text_set(bt, item->label); - -if (item->icon_file) - { - ic = elm_icon_add(bt); - elm_image_resizable_set(ic, EINA_FALSE, EINA_TRUE); - if (item->icon_type == ELM_ICON_FILE) - elm_image_file_set(ic, item->icon_file, item->icon_group); - else if (item->icon_type == ELM_ICON_STANDARD) - elm_icon_standard_set(ic, item->icon_file); - elm_object_part_content_set(bt, "icon", ic); - } - -evas_object_size_hint_weight_set(bt, EVAS_
[EGIT] [core/elementary] master 05/11: elm_spinner: add feature in spinner to change values while dragging relative to the speed of dragging
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=1fa9c23544617907caf0e706c74545117f034c7d commit 1fa9c23544617907caf0e706c74545117f034c7d Author: godly.talias Date: Thu Jun 25 16:27:09 2015 +0200 elm_spinner: add feature in spinner to change values while dragging relative to the speed of dragging Summary: Currently the values in spinner change while dragging only based on the amount of pixels dragged, this patch will enable Spinner to change value based on the speed of dragging so that it will be more user friendly. This will help users to alter drag values by big amounts if dragged in a good speed. Test Plan: test_spinner.c in elementary_test Reviewers: raster, prince.dubey, shilpasingh, cedric Reviewed By: cedric Subscribers: poornima.srinivasan, rajeshps, govi Differential Revision: https://phab.enlightenment.org/D2659 Signed-off-by: Cedric BAIL --- AUTHORS | 1 + src/bin/test_spinner.c | 2 +- src/lib/elm_authors.h| 1 + src/lib/elm_spinner.c| 17 + src/lib/elm_widget_spinner.h | 3 +-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4c6dc9a..404439a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -164,3 +164,4 @@ Jee-Yong Um Ji-In Moon Subodh Kumar Kumar Navneet +Godly T Alias diff --git a/src/bin/test_spinner.c b/src/bin/test_spinner.c index e3c2c4d..41eb63f 100644 --- a/src/bin/test_spinner.c +++ b/src/bin/test_spinner.c @@ -35,7 +35,7 @@ test_spinner(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i elm_spinner_label_format_set(sp, "%1.1f units"); elm_spinner_step_set(sp, 1.3); elm_spinner_wrap_set(sp, EINA_TRUE); - elm_spinner_min_max_set(sp, -50.0, 250.0); + elm_spinner_min_max_set(sp, -5000.0, 5000.0); evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_smart_callback_add(sp, "spinner,drag,start", diff --git a/src/lib/elm_authors.h b/src/lib/elm_authors.h index 6c2f996..71cc0f6 100644 --- a/src/lib/elm_authors.h +++ b/src/lib/elm_authors.h @@ -162,6 +162,7 @@ * @author yinsc * @author Subodh Kumar * @author Kumar Navneet + * @author Godly T Alias * * Please contact to get in * contact with the developers and maintainers. diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 9624380..654e1a6 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -217,11 +217,18 @@ _drag_cb(void *data, else eo_do((Eo *)wd->resize_obj, edje_obj_part_drag_value_get("elm.dragable.slider", &pos, NULL)); + if (sd->drag_prev_pos != 0) + sd->drag_val_step = pow((pos - sd->drag_prev_pos), 2); + else + sd->drag_val_step = 1; + - delta = pos * sd->step * _elm_config->scale; + delta = sd->drag_val_step * sd->step * _elm_config->scale; + if (pos < sd->drag_prev_pos) delta *= -1; + sd->drag_prev_pos = pos; /* If we are on rtl mode, change the delta to be negative on such changes */ if (elm_widget_mirrored_get(obj)) delta *= -1; - if (_value_set(data, sd->drag_start_val + delta)) _label_write(data); + if (_value_set(data, sd->val + delta)) _label_write(data); sd->dragging = 1; } @@ -233,7 +240,8 @@ _drag_start_cb(void *data, { ELM_SPINNER_DATA_GET(data, sd); - sd->drag_start_val = sd->val; + sd->drag_prev_pos = 0; + sd->drag_val_step = 1; evas_object_smart_callback_call(obj, SIG_DRAG_START, NULL); } @@ -247,7 +255,8 @@ _drag_stop_cb(void *data, ELM_SPINNER_DATA_GET(data, sd); ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); - sd->drag_start_val = 0; + sd->drag_prev_pos = 0; + sd->drag_val_step = 1; edje_object_part_drag_value_set (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0); diff --git a/src/lib/elm_widget_spinner.h b/src/lib/elm_widget_spinner.h index d0a4939..151b704 100644 --- a/src/lib/elm_widget_spinner.h +++ b/src/lib/elm_widget_spinner.h @@ -32,8 +32,7 @@ struct _Elm_Spinner_Data const char *label; doubleval, val_min, val_max, val_base; doublestep; /**< step for the value change. 1 by default. */ - doubledrag_start_val; /**< spinner value on drag start. - this is reset to 0 when drag stops. */ + doubledrag_prev_pos, drag_val_step; doublespin_speed, interval, first_interval; int round; Ecore_Timer *delay_change_timer; /**< a timer for a delay,changed smart callback */ --