forked from enlightenment/enlightenment
e_config_dialog: reuse e_dialog on changes between basic and advanced.
This patch will reuse the same e_dialog and thus window while changing contents between basic and advanced. The benefit, among many, is to avoid titlebar flashing like hell when you click the toggle button. By: manio SVN revision: 41314
This commit is contained in:
parent
9da81cfce6
commit
e9942f09de
|
@ -94,7 +94,6 @@ e_config_dialog_find(const char *name, const char *class)
|
|||
|
||||
z = e_util_zone_current_get(e_manager_current_get());
|
||||
e_border_uniconify(cfd->dia->win->border);
|
||||
e_dialog_show(cfd->dia);
|
||||
e_win_raise(cfd->dia->win);
|
||||
if (z->container == cfd->dia->win->border->zone->container)
|
||||
e_border_desk_set(cfd->dia->win->border, e_desk_current_get(z));
|
||||
|
@ -172,12 +171,19 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
|
|||
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC");
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED");
|
||||
|
||||
if (!pdia) /* creating window for the first time */
|
||||
{
|
||||
if ((cfd->view->normal_win) || (e_config->cfgdlg_normal_wins))
|
||||
cfd->dia = e_dialog_normal_win_new(cfd->con, cfd->name, buf);
|
||||
else
|
||||
cfd->dia = e_dialog_new(cfd->con, cfd->name, buf);
|
||||
cfd->dia->data = cfd;
|
||||
e_object_del_attach_func_set(E_OBJECT(cfd->dia), _e_config_dialog_cb_dialog_del);
|
||||
} /* window was created before - deleting content only */
|
||||
else if (cfd->dia->content_object)
|
||||
evas_object_del(cfd->dia->content_object);
|
||||
|
||||
cfd->dia->data = cfd;
|
||||
e_dialog_title_set(cfd->dia, cfd->title);
|
||||
if (!cfd->cfdata) cfd->cfdata = cfd->view->create_cfdata(cfd);
|
||||
|
||||
|
@ -244,6 +250,8 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
|
|||
e_widget_on_change_hook_set(o, _e_config_dialog_cb_changed, cfd);
|
||||
e_dialog_content_set(cfd->dia, o, mw, mh);
|
||||
|
||||
if (!pdia) /* dialog window was created in this function call - need to create buttons once */
|
||||
{
|
||||
if (!cfd->hide_buttons)
|
||||
{
|
||||
e_dialog_button_add(cfd->dia, _("OK"), NULL,
|
||||
|
@ -258,37 +266,12 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
|
|||
}
|
||||
e_dialog_button_add(cfd->dia, _("Close"), NULL,
|
||||
_e_config_dialog_cb_close, cfd);
|
||||
if (!pdia)
|
||||
{
|
||||
if (!cfd->view->normal_win)
|
||||
e_win_centered_set(cfd->dia->win, 1);
|
||||
e_dialog_show(cfd->dia);
|
||||
if (cfd->icon) e_dialog_border_icon_set(cfd->dia, cfd->icon);
|
||||
}
|
||||
else
|
||||
{
|
||||
int x, y;
|
||||
|
||||
e_dialog_show(cfd->dia);
|
||||
if (cfd->icon) e_dialog_border_icon_set(cfd->dia, cfd->icon);
|
||||
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))
|
||||
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);
|
||||
}
|
||||
|
||||
cfd->view_type = type;
|
||||
|
||||
if (pdia)
|
||||
{
|
||||
e_object_del_attach_func_set(E_OBJECT(pdia), NULL);
|
||||
e_util_defer_object_del(E_OBJECT(pdia));
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue