From 1de4f59187bb0ec4fd65e167950f732322dfb9ab Mon Sep 17 00:00:00 2001 From: Artem Popov Date: Sat, 30 Jun 2012 06:40:06 +0000 Subject: [PATCH] From: Artem Popov 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 --- legacy/elementary/ChangeLog | 5 +++++ legacy/elementary/src/lib/elm_panel.c | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index a684e41cce..fc1fe7745a 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -246,3 +246,8 @@ * 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 + diff --git a/legacy/elementary/src/lib/elm_panel.c b/legacy/elementary/src/lib/elm_panel.c index a93a7e0804..3f96c12b84 100644 --- a/legacy/elementary/src/lib/elm_panel.c +++ b/legacy/elementary/src/lib/elm_panel.c @@ -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); }