forked from enlightenment/enlightenment
auto-resize windows up from min size to 1/3rd of screen.
SVN revision: 37729
This commit is contained in:
parent
59c24b5b10
commit
620a5f8989
|
@ -198,6 +198,7 @@ e_dialog_resizable_set(E_Dialog *dia, int resizable)
|
|||
if (resizable)
|
||||
{
|
||||
e_win_size_max_set(dia->win, 99999, 99999);
|
||||
e_util_win_auto_resize_fill(dia->win);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -233,7 +234,11 @@ e_dialog_show(E_Dialog *dia)
|
|||
dia->min_w = mw;
|
||||
dia->min_h = mh;
|
||||
if (!dia->resizable) e_win_size_max_set(dia->win, mw, mh);
|
||||
else e_win_size_max_set(dia->win, 99999, 99999);
|
||||
else
|
||||
{
|
||||
e_win_size_max_set(dia->win, 99999, 99999);
|
||||
e_util_win_auto_resize_fill(dia->win);
|
||||
}
|
||||
e_win_show(dia->win);
|
||||
|
||||
if (!e_widget_focus_get(dia->box_object))
|
||||
|
|
|
@ -930,6 +930,28 @@ e_util_winid_str_get(Ecore_X_Window win)
|
|||
return id;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_util_win_auto_resize_fill(E_Win *win)
|
||||
{
|
||||
E_Zone *zone = NULL;
|
||||
|
||||
if (win->border)
|
||||
zone = win->border->zone;
|
||||
if ((!zone) && (win->container))
|
||||
zone = e_util_zone_current_get(win->container->manager);
|
||||
|
||||
if (zone)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
w = zone->w / 3;
|
||||
h = zone->h / 3;
|
||||
if (w < win->min_w) w = win->min_w;
|
||||
if (h < win->min_h) h = win->min_h;
|
||||
e_win_resize(win, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static int
|
||||
_e_util_cb_delayed_del(void *data)
|
||||
|
|
|
@ -52,6 +52,7 @@ EAPI void e_util_desktop_menu_item_icon_add(Efreet_Desktop *desktop, uns
|
|||
EAPI int e_util_dir_check(const char *dir);
|
||||
EAPI void e_util_defer_object_del(E_Object *obj);
|
||||
EAPI const char *e_util_winid_str_get(Ecore_X_Window win);
|
||||
EAPI void e_util_win_auto_resize_fill(E_Win *win);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -177,8 +177,8 @@ e_configure_show(E_Container *con)
|
|||
edje_object_part_swallow(eco->edje, "e.swallow.button", eco->close);
|
||||
|
||||
edje_object_size_min_calc(eco->edje, &ew, &eh);
|
||||
e_win_resize(eco->win, ew, eh);
|
||||
e_win_size_min_set(eco->win, ew, eh);
|
||||
e_util_win_auto_resize_fill(eco->win);
|
||||
|
||||
evas_object_show(eco->edje);
|
||||
e_win_show(eco->win);
|
||||
|
|
Loading…
Reference in New Issue