discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=1da25bc254c248fb4ceb4f427f9a5ec8a9b32c9b

commit 1da25bc254c248fb4ceb4f427f9a5ec8a9b32c9b
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Tue Jan 14 23:20:40 2014 -0500

    force accuracy in pager16 aspecting
    
    this was inherited from the original pager module where it didn't matter as 
much.
    
    T771
---
 src/modules/pager16/e_mod_main.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/modules/pager16/e_mod_main.c b/src/modules/pager16/e_mod_main.c
index 2dd93ed..cc2f414 100644
--- a/src/modules/pager16/e_mod_main.c
+++ b/src/modules/pager16/e_mod_main.c
@@ -266,6 +266,30 @@ _gc_id_new(const E_Gadcon_Client_Class *client_class)
    return buf;
 }
 
+static void
+_pager_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UNUSED)
+{
+   Pager *p = data;
+   Eina_List *l;
+   Pager_Desk *pd;
+   int w, h, zw, zh;
+
+   zw = p->zone->w, zh = p->zone->h;
+   pd = eina_list_data_get(p->desks);
+   if (!pd) return;
+
+   evas_object_geometry_get(pd->o_desk, NULL, NULL, &w, &h);
+   if (zw * h != zh * w) //aspecting
+     {
+        if (w > h)
+          h = zh * w / zw;
+        else
+          w = zw * h / zh;
+     }
+   EINA_LIST_FOREACH(p->desks, l, pd)
+     e_table_pack_options_set(pd->o_desk, 1, 1, 1, 1, 0.5, 0.5, w, h, -1, -1);
+}
+
 static Pager *
 _pager_new(Evas *evas, E_Zone *zone, E_Gadcon *gc)
 {
@@ -275,6 +299,7 @@ _pager_new(Evas *evas, E_Zone *zone, E_Gadcon *gc)
    p->inst = NULL;
    p->popup = NULL;
    p->o_table = e_table_add(evas);
+   evas_object_event_callback_add(p->o_table, EVAS_CALLBACK_RESIZE, 
_pager_resize, p);
    e_table_homogenous_set(p->o_table, 1);
    p->zone = zone;
    _pager_fill(p, gc);

-- 


Reply via email to