From: Enlightenment S. <no-...@en...> - 2011-01-24 10:50:37
|
Log: Will soon commit a better solution instead. Revert "Elementary scroller: Fixed an issue in scroller. When a resize happens (or any change for that matter), we should go to the last "asked for" location. This for example fixes an issue with elm_scrolled_entry (and many other widgets) showing "empty regions" on some resizes." This reverts commit f322bd28101518849c53e6d56b93c206e4129162. Author: tasn Date: 2011-01-24 02:50:30 -0800 (Mon, 24 Jan 2011) New Revision: 56282 Trac: http://trac.enlightenment.org/e/changeset/56282 Modified: trunk/TMP/st/elementary/src/lib/elm_scroller.c trunk/TMP/st/elementary/src/lib/els_scroller.c Modified: trunk/TMP/st/elementary/src/lib/elm_scroller.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elm_scroller.c 2011-01-24 10:50:27 UTC (rev 56281) +++ trunk/TMP/st/elementary/src/lib/elm_scroller.c 2011-01-24 10:50:30 UTC (rev 56282) @@ -34,7 +34,6 @@ struct _Widget_Data { - Evas_Coord wx, wy, ww, wh; /* Last "wanted" geometry */ Evas_Object *scr; Evas_Object *content; const char *widget_name, *widget_base; @@ -248,15 +247,20 @@ static void _show_region_hook(void *data, Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord x, y, w, h; + if (!wd) return; elm_widget_show_region_get(obj, &x, &y, &w, &h); - elm_scroller_region_show(data, x, y, w, h); + if (wd->scr) + elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } static void _focus_region_hook(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { - elm_scroller_region_show(obj, x, y, w, h); + Widget_Data *wd = elm_widget_data_get(obj); + if (wd->scr) + elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } static void @@ -295,7 +299,6 @@ if ((maxw > 0) && (w > maxw)) w = maxw; if ((maxh > 0) && (h > maxh)) h = maxh; evas_object_size_hint_min_set(obj, w, h); - elm_smart_scroller_child_region_show(wd->scr, wd->wx, wd->wy, wd->ww, wd->wh); } } @@ -528,8 +531,6 @@ if (!wd) return; if (wd->content == content) return; if (wd->content) evas_object_del(wd->content); - wd->wx = wd->wh = wd->ww = wd->wy = 0; - wd->content = content; if (content) { @@ -654,11 +655,6 @@ ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->scr)) return; - wd->wx = x; - wd->wh = h; - wd->ww = w; - wd->wy = y; - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } @@ -876,10 +872,6 @@ ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->scr)) return; - wd->wx = x; - wd->wh = h; - wd->ww = w; - wd->wy = y; elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); } Modified: trunk/TMP/st/elementary/src/lib/els_scroller.c =================================================================== --- trunk/TMP/st/elementary/src/lib/els_scroller.c 2011-01-24 10:50:27 UTC (rev 56281) +++ trunk/TMP/st/elementary/src/lib/els_scroller.c 2011-01-24 10:50:30 UTC (rev 56282) @@ -941,9 +941,7 @@ ny = y + h - (ch - my); if (ny > y) ny = y; } - /* Note: this function should "show" a cursor position even if it's the same - * as the cached position, because it makes sense if the size of the - * scroller or the child have changed */ + if ((nx == px) && (ny == py)) return; if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) || (sd->scrollto.x.animator) || (sd->scrollto.y.animator)) { |