From d236e2acece07d7dc611cc7ef1f52e77ceaac922 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Jul 2013 12:50:28 +0100 Subject: [PATCH] bugfix: fileman double click auto-resizing now accounts for toolbar/sidebar and accounts for maximized state T208 --- ChangeLog | 4 ++++ NEWS | 1 + src/modules/fileman/e_fwin.c | 10 ++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce5f52e5f..b8a07e70b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-07-26 Mike Blumenkrantz + + * fixed bug where double clicking filemanager windows would not correctly autosize + 2013-06-20 Mike Blumenkrantz * udisks2 support diff --git a/NEWS b/NEWS index 8e51d7e98..259e9214c 100644 --- a/NEWS +++ b/NEWS @@ -226,3 +226,4 @@ Fixes: * fixed bug where e widgets would not unset focus * fixed bug with filemanager setting path with too many spaces when opened from menu * fixed crash when multiple windows shared a remember + * fixed bug where double clicking filemanager windows would not correctly autosize diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c index c823810cf..438ef0d35 100644 --- a/src/modules/fileman/e_fwin.c +++ b/src/modules/fileman/e_fwin.c @@ -624,15 +624,21 @@ e_fwin_zone_find(E_Zone *zone) static void _e_fwin_bg_mouse_down(E_Fwin *fwin, Evas_Object *obj __UNUSED__, void *event __UNUSED__) { - int x, y, w, h, zx, zy, zw, zh; + int x, y, w, h, zx, zy, zw, zh, cx, cy, cw, ch; + + if (fwin->win->border->maximized) e_border_unmaximize(fwin->win->border, fwin->win->border->maximized); + if (fwin->win->border->fullscreen) e_border_unfullscreen(fwin->win->border); e_zone_useful_geometry_get(fwin->win->border->zone, &zx, &zy, &zw, &zh); x = fwin->win->border->x, y = fwin->win->border->y; if (!e_fm2_optimal_size_calc(fwin->cur_page->fm_obj, zw - x, zh - y, &w, &h)) return; + evas_object_geometry_get(fwin->cur_page->fm_obj, &cx, &cy, &cw, &ch); if (x + w > zx + zw) w = zx + zw - x; if (y + x > zy + zh) h = zy + zh - y; - e_win_resize(fwin->win, w, h); + w = w + cx; + h = h + cx; + e_win_resize(fwin->win, MAX(w, 360), MAX(h, 250)); } static E_Fwin *