proper alignment when there is non-autohide shelves.

SVN revision: 40384
This commit is contained in:
Gustavo Sverzut Barbieri 2009-04-25 18:49:39 +00:00
parent 8f923e67c1
commit 7120b06df7
3 changed files with 17 additions and 6 deletions

View File

@ -841,11 +841,9 @@ ACT_FN_GO(window_move_to_center)
}
E_Border *bd;
bd = (E_Border *)obj;
int x, y;
x = (bd->zone->w - bd->w) / 2;
y = (bd->zone->h - bd->h) / 2;
bd = (E_Border *)obj;
e_border_center_pos_get(bd, &x, &y);
if ((x != bd->x) || (y != bd->y))
{
@ -853,8 +851,8 @@ ACT_FN_GO(window_move_to_center)
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2),
bd->y + (bd->h / 2));
x + (bd->w / 2),
y + (bd->h / 2));
}
}

View File

@ -921,6 +921,18 @@ e_border_center(E_Border *bd)
e_border_move(bd, x + (w - bd->w) / 2, y + (h - bd->h) / 2);
}
EAPI void
e_border_center_pos_get(E_Border *bd, int *x, int *y)
{
int zx, zy, zw, zh;
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
e_zone_useful_geometry_get(bd->zone, &zx, &zy, &zw, &zh);
if (x) *x = zx + (zw - bd->w) / 2;
if (y) *y = zy + (zh - bd->h) / 2;
}
EAPI void
e_border_fx_offset(E_Border *bd, int x, int y)
{

View File

@ -566,6 +566,7 @@ EAPI void e_border_hide(E_Border *bd, int manage);
EAPI void e_border_move(E_Border *bd, int x, int y);
EAPI void e_border_move_without_border(E_Border *bd, int x, int y);
EAPI void e_border_center(E_Border *bd);
EAPI void e_border_center_pos_get(E_Border *bd, int *x, int *y);
EAPI void e_border_fx_offset(E_Border *bd, int x, int y);
EAPI void e_border_resize(E_Border *bd, int w, int h);
EAPI void e_border_resize_without_border(E_Border *bd, int w, int h);