Gustavo Sverzut Barbieri wrote:
I like morphing/changing the window content more than recreating it as
we do today.
As for the crash, I fixed the crash by invalidating the deleted
e_border, but there is still a damn bug I wasted hours without being
able to solve it, see my comment in commit
http://trac.enlightenment.org/e/changeset/41038 Any help is
appreciated.
i was trying to create a patch for changing only dialog contents using
same window and not creating
the new windows for basic/advanced
current state of my patch is attached
it works ok except one thing - after first "content switch" the window
height is smaller then it should be
(looks like smaller for a border height).
If i change the window to borderless (commented line in patch) - it
looks ok - so it seems this is a
problem related with border...
regards
--
manio
jabber/e-mail: ma...@skyboo.net
http://manio.skyboo.net
Index: e_config_dialog.c
===================================================================
--- e_config_dialog.c (revision 41029)
+++ e_config_dialog.c (working copy)
@@ -172,12 +172,20 @@
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC");
else
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED");
- 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);
+
+ 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);
+ e_object_del_attach_func_set(E_OBJECT(cfd->dia),
_e_config_dialog_cb_dialog_del);
+ //e_win_borderless_set(cfd->dia->win, 1); //<-- uncomment this line to
see that after changing basic/advanced window size is OK :)
+ } /* 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_object_del_attach_func_set(E_OBJECT(cfd->dia),
_e_config_dialog_cb_dialog_del);
e_dialog_title_set(cfd->dia, cfd->title);
if (!cfd->cfdata) cfd->cfdata = cfd->view->create_cfdata(cfd);
@@ -244,51 +252,29 @@
e_widget_on_change_hook_set(o, _e_config_dialog_cb_changed, cfd);
e_dialog_content_set(cfd->dia, o, mw, mh);
- if (!cfd->hide_buttons)
+ if (!pdia) /* dialog window was created in this function call - need to
create buttons once */
{
- e_dialog_button_add(cfd->dia, _("OK"), NULL,
- _e_config_dialog_cb_ok, cfd);
- e_dialog_button_add(cfd->dia, _("Apply"), NULL,
- _e_config_dialog_cb_apply, cfd);
- if (!cfd->cfg_changed)
- {
- e_dialog_button_disable_num_set(cfd->dia, 0, 1);
- e_dialog_button_disable_num_set(cfd->dia, 1, 1);
- }
- }
- 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;
+ if (!cfd->hide_buttons)
+ {
+ e_dialog_button_add(cfd->dia, _("OK"), NULL,
+ _e_config_dialog_cb_ok, cfd);
+ e_dialog_button_add(cfd->dia, _("Apply"), NULL,
+ _e_config_dialog_cb_apply, cfd);
+ if (!cfd->cfg_changed)
+ {
+ e_dialog_button_disable_num_set(cfd->dia, 0, 1);
+ e_dialog_button_disable_num_set(cfd->dia, 1, 1);
+ }
+ }
+ e_dialog_button_add(cfd->dia, _("Close"), NULL,
+ _e_config_dialog_cb_close, cfd);
+ }
- 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;
+ e_dialog_show(cfd->dia);
+ evas_object_resize(cfd->dia->bg_object, cfd->dia->win->w, cfd->dia->win->h);
+ if (cfd->icon) e_dialog_border_icon_set(cfd->dia, cfd->icon);
- if (pdia)
- {
- e_object_del_attach_func_set(E_OBJECT(pdia), NULL);
- e_util_defer_object_del(E_OBJECT(pdia));
- }
+ cfd->view_type = type;
}
static int
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel