From: Artem Popov <artem.popov@samsung.com>
authorArtem Popov <artem.popov@samsung.com>
Sat, 30 Jun 2012 06:40:06 +0000 (06:40 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Sat, 30 Jun 2012 06:40:06 +0000 (06:40 +0000)
Subject: [E-devel]  [Patch] Patch for normal scaling in elm_panel.c
widget

Problem:

   Ticket #656 (new Bug) . The whole test window size will just grow
larger and
   larger on each _theme_hook called.

   Easy to reproduce: 1. Open elementary_test's panel test 2. Do
something that
   issues a theme_hook (change scale etc)

SVN revision: 73076

ChangeLog
src/lib/elm_panel.c

index a684e41..fc1fe77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * Add elm_config_access_set/get() to allow for a config tool to enable
         to diasbale access mode.
         * Add access highlight infra
+
+2012-06-30 Artem Popov
+
+       * Fix panel theme_hook handling for scaling
+
index a93a7e0..3f96c12 100644 (file)
@@ -51,6 +51,7 @@ _theme_hook(Evas_Object *obj)
      {
         Evas_Object *edj;
         const char *str;
+        //   double scale;
 
         _mirrored_set(obj, elm_widget_mirrored_get(obj));
         elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base",
@@ -141,15 +142,27 @@ _sizing_eval(Evas_Object *obj)
    if (w < mw) w = mw;
    if (h < mh) h = mh;
    evas_object_resize(wd->scr, w, h);
-
    evas_object_size_hint_min_get(wd->bx, &mw, &mh);
-   if (w > mw) mw = w;
-   if (h > mh) mh = h;
-   evas_object_resize(wd->bx, mw, mh);
+/*
+   if (w > mw) mw = w; // when scale resized panel then minweight = resized weight
+   if (h > mh) mh = h; // when scale resized panel then minheight = resized height
+   evas_object_resize(wd->bx, mw, mh);*/
 
    elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
-   mw = mw + (w - vw);
-   mh = mh + (h - vh);
+   if ((wd->orient == ELM_PANEL_ORIENT_LEFT) || (wd->orient == ELM_PANEL_ORIENT_RIGHT))  
+     {
+        //  if (w > mw) mw = w; // when scale resized panel then minweight = resized weight
+        if (w > vw) vw = w;
+        mw = mw + (w - vw); 
+        mh = mh + (h - vh);
+     }
+     else if ((wd->orient == ELM_PANEL_ORIENT_TOP) || (wd->orient == ELM_PANEL_ORIENT_BOTTOM))  
+       {
+          mw = mw + (w - vw);
+          mh = mh + (h - vh);
+       }
+
+   evas_object_resize(wd->bx, mw, mh);
    evas_object_size_hint_min_set(obj, mw, mh);
    evas_object_size_hint_max_set(obj, -1, -1);
 }