From: Enlightenment S. <no-...@en...> - 2012-01-05 12:00:06
|
Log: show image geom in window title Author: discomfitor Date: 2012-01-05 03:59:56 -0800 (Thu, 05 Jan 2012) New Revision: 66900 Trac: http://trac.enlightenment.org/e/changeset/66900 Modified: trunk/PROTO/ev/ev.c Modified: trunk/PROTO/ev/ev.c =================================================================== --- trunk/PROTO/ev/ev.c 2012-01-05 10:08:08 UTC (rev 66899) +++ trunk/PROTO/ev/ev.c 2012-01-05 11:59:56 UTC (rev 66900) @@ -54,6 +54,21 @@ } static void +_title(Evas_Object *win) +{ + Evas_Coord ww, wh; + char buf[8192]; + const char *f, *s; + + evas_object_geometry_get(img, NULL, NULL, &ww, &wh); + elm_icon_file_get(img, &f, NULL); + s = strrchr(f, '/'); + s = s ? s + 1 : f; + snprintf(buf, sizeof(buf), "%s (%ux%u)", s, ww, wh); + elm_win_title_set(win, buf); +} + +static void _resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *einfo __UNUSED__) { Evas_Coord w, h; @@ -91,6 +106,7 @@ } evas_object_geometry_get(win, NULL, NULL, &ww, &wh); evas_object_move(img, (ww / 2) - (w / 2), (wh / 2) - (h / 2)); + _title(win); INF("w=%d, h=%d, x=%d, y=%d", w, h, (ww / 2) - (w / 2), (wh / 2) - (h / 2)); INF("ww=%d, wh=%d", ww, wh); } @@ -114,7 +130,7 @@ elm_icon_file_set(img, file, NULL); _resize(NULL, NULL, NULL, NULL); win = elm_object_parent_widget_get(img); - elm_win_title_set(win, file); + _title(win); } static void |