aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-11 16:23:05 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-11 16:24:00 -0500
commitb95e28fd91d2d61d8543fdf1bf86fccf5c9f2082 (patch)
tree326775c04ff38ec6c543bc78a66243aab1ab8390
parentpass correct pointer to sandbox gadget tooltip destructor (diff)
downloadenlightenment-b95e28fd91d2d61d8543fdf1bf86fccf5c9f2082.tar.gz
propagate sandboxed gadget tooltip sizes as aspects
xdg_popup does not have min size hints, so instead we can proxy aspect through to mimic this behavior
-rw-r--r--src/bin/e_gadget_loader.c10
-rw-r--r--src/bin/e_gadget_runner.c12
2 files changed, 22 insertions, 0 deletions
diff --git a/src/bin/e_gadget_loader.c b/src/bin/e_gadget_loader.c
index 2f010a93a..52a098250 100644
--- a/src/bin/e_gadget_loader.c
+++ b/src/bin/e_gadget_loader.c
@@ -273,6 +273,15 @@ win_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *eve
tooltips = eina_list_remove(tooltips, obj);
}
+static void
+_tooltip_resize(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ int w, h;
+
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ evas_object_size_hint_aspect_set(obj, EVAS_ASPECT_CONTROL_BOTH, w, h);
+}
+
static Evas_Object *
win_add(Evas_Object *win)
{
@@ -284,6 +293,7 @@ win_add(Evas_Object *win)
if (elm_win_type_get(win) == ELM_WIN_TOOLTIP)
{
tooltips = eina_list_append(tooltips, win);
+ evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _tooltip_resize, d);
if (eina_hash_population(gadget_globals))
{
struct e_gadget *gadget_global = eina_hash_find(gadget_globals, &d);
diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c
index b90da0e76..3da1024ea 100644
--- a/src/bin/e_gadget_runner.c
+++ b/src/bin/e_gadget_runner.c
@@ -638,6 +638,14 @@ tooltip_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info
tt->tooltip_surface = NULL;
}
+static void
+tooltip_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ int w, h;
+ evas_object_size_hint_aspect_get(obj, NULL, &w, &h);
+ evas_object_size_hint_min_set(obj, w, h);
+}
+
static Evas_Object *
tooltip_content_cb(void *data, Evas_Object *obj EINA_UNUSED, Evas_Object *tooltip)
{
@@ -685,11 +693,15 @@ popup_added(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
tt = &inst->base;
if (tt)
{
+ int w, h;
tt->tooltip_surface = surface;
tt->tooltip_content = event_info;
evas_object_data_set(event_info, "instance", inst);
evas_object_pass_events_set(event_info, 1);
+ E_FILL(event_info);
+ tooltip_hints(NULL, NULL, event_info, NULL);
evas_object_event_callback_add(event_info, EVAS_CALLBACK_DEL, tooltip_del, tt);
+ evas_object_event_callback_add(event_info, EVAS_CALLBACK_CHANGED_SIZE_HINTS, tooltip_hints, tt);
elm_object_tooltip_content_cb_set(tt->obj, tooltip_content_cb, tt, NULL);
}
else