forked from enlightenment/enlightenment
Fix Theme About to not allow multiple instances (like E About & E Configure).
SVN revision: 28754
This commit is contained in:
parent
79c99d4295
commit
701f47766e
|
@ -8,6 +8,8 @@ static void _e_theme_about_free(E_Theme_About *about);
|
||||||
static void _e_theme_about_cb_delete(E_Win *win);
|
static void _e_theme_about_cb_delete(E_Win *win);
|
||||||
static void _e_theme_about_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source);
|
static void _e_theme_about_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||||
|
|
||||||
|
static E_Theme_About *_e_theme_about = NULL;
|
||||||
|
|
||||||
/* local subsystem globals */
|
/* local subsystem globals */
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
|
@ -19,6 +21,28 @@ e_theme_about_new(E_Container *con)
|
||||||
E_Manager *man;
|
E_Manager *man;
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
|
|
||||||
|
if (_e_theme_about)
|
||||||
|
{
|
||||||
|
E_Zone *z, *z2;
|
||||||
|
|
||||||
|
about = _e_theme_about;
|
||||||
|
z = e_util_zone_current_get(e_manager_current_get());
|
||||||
|
z2 = about->win->border->zone;
|
||||||
|
e_win_show(about->win);
|
||||||
|
e_win_raise(about->win);
|
||||||
|
if (z->container == z2->container)
|
||||||
|
e_border_desk_set(about->win->border, e_desk_current_get(z));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!about->win->border->sticky)
|
||||||
|
e_desk_show(about->win->border->desk);
|
||||||
|
ecore_x_pointer_warp(z2->container->win,
|
||||||
|
z2->x + (z2->w / 2), z2->y + (z2->h / 2));
|
||||||
|
}
|
||||||
|
e_border_unshade(about->win->border, E_DIRECTION_DOWN);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!con)
|
if (!con)
|
||||||
{
|
{
|
||||||
man = e_manager_current_get();
|
man = e_manager_current_get();
|
||||||
|
@ -51,6 +75,8 @@ e_theme_about_new(E_Container *con)
|
||||||
edje_object_signal_callback_add(about->bg_object, "e,action,close", "",
|
edje_object_signal_callback_add(about->bg_object, "e,action,close", "",
|
||||||
_e_theme_about_cb_close, about);
|
_e_theme_about_cb_close, about);
|
||||||
e_win_centered_set(about->win, 1);
|
e_win_centered_set(about->win, 1);
|
||||||
|
|
||||||
|
_e_theme_about = about;
|
||||||
return about;
|
return about;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +105,7 @@ e_theme_about_show(E_Theme_About *about)
|
||||||
static void
|
static void
|
||||||
_e_theme_about_free(E_Theme_About *about)
|
_e_theme_about_free(E_Theme_About *about)
|
||||||
{
|
{
|
||||||
|
_e_theme_about = NULL;
|
||||||
if (about->bg_object) evas_object_del(about->bg_object);
|
if (about->bg_object) evas_object_del(about->bg_object);
|
||||||
e_object_del(E_OBJECT(about->win));
|
e_object_del(E_OBJECT(about->win));
|
||||||
free(about);
|
free(about);
|
||||||
|
@ -90,6 +117,7 @@ _e_theme_about_cb_delete(E_Win *win)
|
||||||
E_Theme_About *about;
|
E_Theme_About *about;
|
||||||
|
|
||||||
about = win->data;
|
about = win->data;
|
||||||
|
if (!about) return;
|
||||||
e_object_del(E_OBJECT(about));
|
e_object_del(E_OBJECT(about));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,5 +127,6 @@ _e_theme_about_cb_close(void *data, Evas_Object *obj, const char *emission, cons
|
||||||
E_Theme_About *about;
|
E_Theme_About *about;
|
||||||
|
|
||||||
about = data;
|
about = data;
|
||||||
|
if (!about) return;
|
||||||
e_object_del(E_OBJECT(about));
|
e_object_del(E_OBJECT(about));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue