From cea551578c487c4182e2f5e06f9238ce851b64f1 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Nov 2016 11:01:43 -0400 Subject: [PATCH 1/6] do not apply efx anchoring to move effects if a resize effect is not active this is useless without an animator fix T4810 --- src/bin/efx/efx_resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/efx/efx_resize.c b/src/bin/efx/efx_resize.c index ee0750576..33a1a0df2 100644 --- a/src/bin/efx/efx_resize.c +++ b/src/bin/efx/efx_resize.c @@ -124,7 +124,7 @@ _e_efx_resize_adjust(E_EFX *e, int *ax, int *ay) E_Efx_Resize_Data *erd = e->resize_data; int x, y, w, h; - if (!erd) return; + if ((!erd) || (!erd->anim)) return; if (e->move_data) x = e->x, y = e->y; else From 814ee0dc846c50367342e5ecc8225168f826b7fe Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Nov 2016 12:56:51 -0400 Subject: [PATCH 2/6] use only aspect sizing in luncher using min size hints will break gadget scaling fix T4809 --- src/modules/luncher/bar.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/modules/luncher/bar.c b/src/modules/luncher/bar.c index 414ebd6f1..da38529a9 100644 --- a/src/modules/luncher/bar.c +++ b/src/modules/luncher/bar.c @@ -900,7 +900,9 @@ _bar_icon_add(Instance *inst, Efreet_Desktop *desktop, E_Client *non_desktop_cli ic->o_layout = elm_layout_add(inst->o_icon_con); e_theme_edje_object_set(ic->o_layout, "e/gadget/luncher/icon", "e/gadget/luncher/icon"); - evas_object_size_hint_min_set(ic->o_layout, inst->size, inst->size); + //evas_object_size_hint_min_set(ic->o_layout, inst->size, inst->size); + E_EXPAND(ic->o_layout); + E_FILL(ic->o_layout); elm_box_pack_end(inst->o_icon_con, ic->o_layout); evas_object_show(ic->o_layout); @@ -1376,6 +1378,14 @@ _bar_fill(Instance *inst) inst->icons = eina_list_append(inst->icons, ic); } } + switch (e_gadget_site_orient_get(e_gadget_site_get(inst->o_main))) + { + case E_GADGET_SITE_ORIENT_VERTICAL: + evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, 1, eina_list_count(inst->icons)); + break; + default: + evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, eina_list_count(inst->icons), 1); + } } static void @@ -1389,6 +1399,7 @@ _bar_resize_job(void *data) if (inst) { + elm_layout_sizing_eval(inst->o_main); evas_object_geometry_get(inst->o_main, &x, &y, &w, &h); switch (orient) { @@ -1404,7 +1415,7 @@ _bar_resize_job(void *data) inst->size = size; EINA_LIST_FOREACH(inst->icons, l, ic) { - const char *path = NULL, *key = NULL; + const char *path = NULL, *key = NULL; int len = 0; if (ic->desktop) @@ -1476,7 +1487,7 @@ _bar_resize_job(void *data) elm_image_file_set(ic->o_overlay, e_theme_edje_file_get("base/theme/icons", "e/icons/unknown"), "e/icons/unknown"); } - evas_object_size_hint_min_set(ic->o_layout, inst->size, inst->size); + //evas_object_size_hint_min_set(ic->o_layout, inst->size, inst->size); } inst->resize_job = NULL; } From ffef2d0770a0aed2e259370b5b2d4b07dd0051c1 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Nov 2016 13:01:33 -0400 Subject: [PATCH 3/6] update luncher aspect hints whenever icon list is modified --- src/modules/luncher/bar.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/modules/luncher/bar.c b/src/modules/luncher/bar.c index da38529a9..2488031b3 100644 --- a/src/modules/luncher/bar.c +++ b/src/modules/luncher/bar.c @@ -4,6 +4,19 @@ static Evas_Object *current_preview; static Eina_Bool current_preview_menu; static Eina_Bool _bar_icon_preview_show(void *data); +static void +_bar_aspect(Instance *inst) +{ + switch (e_gadget_site_orient_get(e_gadget_site_get(inst->o_main))) + { + case E_GADGET_SITE_ORIENT_VERTICAL: + evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, 1, eina_list_count(inst->icons)); + break; + default: + evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, eina_list_count(inst->icons), 1); + } +} + static Eina_Bool _bar_check_modifiers(Evas_Modifier *modifiers) { @@ -171,6 +184,7 @@ static void _bar_icon_del(Instance *inst, Icon *ic) { inst->icons = eina_list_remove(inst->icons, ic); + _bar_aspect(inst); evas_object_del(ic->o_layout); evas_object_del(ic->o_icon); eina_hash_del_by_data(inst->icons_desktop_hash, ic); @@ -1201,6 +1215,7 @@ _bar_cb_exec_client_prop(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_C elm_layout_signal_emit(ic->o_layout, buf, "e"); ic->in_order = EINA_FALSE; inst->icons = eina_list_append(inst->icons, ic); + _bar_aspect(inst); } } else @@ -1287,6 +1302,7 @@ _bar_cb_exec_new(void *data EINA_UNUSED, int type, E_Exec_Instance *ex) elm_layout_signal_emit(ic->o_layout, buf, "e"); ic->in_order = EINA_FALSE; inst->icons = eina_list_append(inst->icons, ic); + _bar_aspect(inst); } } return ECORE_CALLBACK_RENEW; @@ -1378,14 +1394,7 @@ _bar_fill(Instance *inst) inst->icons = eina_list_append(inst->icons, ic); } } - switch (e_gadget_site_orient_get(e_gadget_site_get(inst->o_main))) - { - case E_GADGET_SITE_ORIENT_VERTICAL: - evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, 1, eina_list_count(inst->icons)); - break; - default: - evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, eina_list_count(inst->icons), 1); - } + _bar_aspect(inst); } static void From debd88b91cc94d41e2d9e53f1c121c2b8adada3f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Nov 2016 13:01:51 -0400 Subject: [PATCH 4/6] do not create new luncher cfg id for demo gadgets -1 indicates a temporary gadget which should not be saved --- src/modules/luncher/bar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/luncher/bar.c b/src/modules/luncher/bar.c index 2488031b3..29642829d 100644 --- a/src/modules/luncher/bar.c +++ b/src/modules/luncher/bar.c @@ -1772,8 +1772,11 @@ _conf_item_get(int *id) } ci = E_NEW(Config_Item, 1); - - ci->id = eina_list_count(luncher_config->items)+1; + + if (*id != -1) + ci->id = eina_list_count(luncher_config->items)+1; + else + ci->id = -1; ci->dir = eina_stringshare_add("default"); luncher_config->items = eina_list_append(luncher_config->items, ci); From 6e39997ad123ac00756285f5c62dd3fc13726fde Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Nov 2016 13:29:45 -0400 Subject: [PATCH 5/6] add smart callback for when gadgets get reparented this can be useful for gadgets which (inexplicably) need to set min size hints --- src/bin/e_bryce.c | 1 + src/bin/e_gadget.h | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/e_bryce.c b/src/bin/e_bryce.c index 613727789..7b74ad09f 100644 --- a/src/bin/e_bryce.c +++ b/src/bin/e_bryce.c @@ -352,6 +352,7 @@ _bryce_style(Evas_Object *site, Eina_Stringshare *name, Evas_Object *g) e_theme_edje_object_set(ly, NULL, buf); prev = e_gadget_util_layout_style_init(g, ly); elm_object_part_content_set(ly, "e.swallow.content", g); + evas_object_smart_callback_call(g, "gadget_reparent", ly); evas_object_del(prev); } diff --git a/src/bin/e_gadget.h b/src/bin/e_gadget.h index 29be55379..94ff5eeee 100644 --- a/src/bin/e_gadget.h +++ b/src/bin/e_gadget.h @@ -70,7 +70,12 @@ - called on a gadget object when the "gadget_menu" action has been triggered - event_info is an E_Menu object - if a configure callback has been passed with e_gadget_configure_cb_set(), - a "Settings" item will be automatically added with this callback + a "Settings" item will be automatically added with this callback + "gadget_reparent" + - called on a gadget object when the gadget has been reparented + - parent object is event_info + - indicates that the gadget should watch this new object for EVAS_CALLBACK_RESIZE + - event_info will be NULL in the case that the reparenting removes the parent ------------------------------- ------------------------------- * called externally by gadget on gadget object: From 4d86c98ce76e07c220bf68ab3ecefe53b0b7d335 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Nov 2016 13:56:08 -0400 Subject: [PATCH 6/6] do not return early from _bryce_position() this causes the returned coords to be garbage values, likely leading to the bryce being positioned or animating off to the upper-right corner of the universe that exists beyond the canvas --- src/bin/e_bryce.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bin/e_bryce.c b/src/bin/e_bryce.c index 7b74ad09f..d2244351b 100644 --- a/src/bin/e_bryce.c +++ b/src/bin/e_bryce.c @@ -174,7 +174,6 @@ _bryce_position(Bryce *b, int w, int h, int *nx, int *ny) } else e_efx_move(b->bryce, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_POINT(x, y), 0.5, _bryce_autohide_end, b); - return; } else if (b->hidden) _bryce_autohide_coords(b, &x, &y);