fix annoying bug with config dialog window layout.

as spotted by manio, toggling between "Basic" and "Advanced" mode was
making the window move (just open Theme dialog and toggle).

Manio suggested a fix by keeping window center between both modes, but
I think that given our top-left to bottom-right reading (LTR) we
better keep the title bar (x,y) intact and avoid full rescan. This can
be weird in small screens where the dialog will not be centered
anymore and that will show easily, but on regular screens this should
not be an issue.

Also spotted that it was wrong when trying to avoid window overflow
(using x instead of y).

PS: I wonder why we destroy and create the window all over again! This
is really annoying, title bar will show the focus animation and you
get lost (need to rescan it again).




SVN revision: 41004
This commit is contained in:
Gustavo Sverzut Barbieri 2009-06-10 22:53:00 +00:00
parent 5f3e20a43c
commit 2406757ec9
1 changed files with 3 additions and 3 deletions

View File

@ -271,14 +271,14 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
e_dialog_show(cfd->dia);
if (cfd->icon) e_dialog_border_icon_set(cfd->dia, cfd->icon);
x = pdia->win->border->x + ((pdia->win->w - cfd->dia->win->w) / 2);
y = pdia->win->border->y + ((pdia->win->h - cfd->dia->win->h) / 2);
x = pdia->win->x;
y = pdia->win->y;
if (x < 0) x = 0;
if (y < 0) y = 0;
if ((x + cfd->dia->win->w) > (pdia->win->container->w))
x = pdia->win->container->w - cfd->dia->win->w;
if ((y + cfd->dia->win->h) > (pdia->win->container->h))
x = pdia->win->container->h - cfd->dia->win->h;
y = pdia->win->container->h - cfd->dia->win->h;
e_win_move(cfd->dia->win, x, y);
e_win_placed_set(cfd->dia->win, 1);
}