forked from enlightenment/enlightenment
fix e_fm window initial position and size
SVN revision: 42884
This commit is contained in:
parent
5205ef0ec3
commit
2581c25c2d
|
@ -1685,7 +1685,12 @@ _e_fwin_file_open_dialog(E_Fwin_Page *page, Eina_List *files, int always)
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
/* No custom info, so just put window near icon */
|
int w, h, zw, zh;
|
||||||
|
|
||||||
|
e_zone_useful_geometry_get(fwin2->win->border->zone,
|
||||||
|
NULL, NULL, &zw, &zh);
|
||||||
|
|
||||||
|
/* No custom info, so just put window near icon */
|
||||||
e_fm2_icon_geometry_get(ici->ic, &ix, &iy, &iw, &ih);
|
e_fm2_icon_geometry_get(ici->ic, &ix, &iy, &iw, &ih);
|
||||||
nx = (ix + (iw / 2));
|
nx = (ix + (iw / 2));
|
||||||
ny = (iy + (ih / 2));
|
ny = (iy + (ih / 2));
|
||||||
|
@ -1694,16 +1699,30 @@ _e_fwin_file_open_dialog(E_Fwin_Page *page, Eina_List *files, int always)
|
||||||
nx += fwin->win->x;
|
nx += fwin->win->x;
|
||||||
ny += fwin->win->y;
|
ny += fwin->win->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* checking width and height */
|
||||||
|
/* TODO add config for preffered
|
||||||
|
initial size? */
|
||||||
|
w = 5 * iw * e_scale;
|
||||||
|
if (w > 400)
|
||||||
|
w = 400;
|
||||||
|
if (w > zw)
|
||||||
|
w = zw;
|
||||||
|
|
||||||
|
h = 4 * ih * e_scale;
|
||||||
|
if (h > 300)
|
||||||
|
h = 300;
|
||||||
|
if (h > zh)
|
||||||
|
h = zh;
|
||||||
|
|
||||||
/* iff going out of zone - adjust to be in */
|
/* iff going out of zone - adjust to be in */
|
||||||
if ((fwin2->win->border->zone->x +
|
if ((fwin2->win->border->zone->x + fwin2->win->border->zone->w) < (w + nx))
|
||||||
fwin2->win->border->zone->w) <
|
nx -= w;
|
||||||
(fwin2->win->border->w + nx))
|
if ((fwin2->win->border->zone->y + fwin2->win->border->zone->h) < (h + ny))
|
||||||
nx -= fwin2->win->border->w;
|
ny -= h;
|
||||||
if ((fwin2->win->border->zone->y +
|
|
||||||
fwin2->win->border->zone->h) <
|
e_win_move_resize(fwin2->win, nx, ny, w, h);
|
||||||
(fwin2->win->border->h + ny))
|
fwin2->win->border->placed = 1;
|
||||||
ny -= fwin2->win->border->h;
|
|
||||||
e_win_move(fwin2->win, nx, ny);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ici->label)
|
if (ici->label)
|
||||||
|
|
Loading…
Reference in New Issue