entrance: manage user wallpaper transition

This commit is contained in:
Michael Bouchaud 2014-01-08 22:27:54 +01:00
parent 1df4d95c89
commit 6a77df16f2
3 changed files with 52 additions and 1 deletions

View File

@ -15,6 +15,7 @@ static void _entrance_gui_actions_populate();
static void _entrance_gui_conf_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void _entrance_gui_update(void);
static void _entrance_gui_auth_cb(void *data, const char *user, Eina_Bool granted);
static void _entrance_gui_user_bg_cb(void *data, Evas_Object *obj, const char *signal, const char *source);
static Entrance_Gui *_gui;
@ -100,6 +101,8 @@ entrance_gui_init(const char *theme)
/* layout */
o = entrance_gui_theme_get(_gui->win, "entrance/wallpaper/default");
screen->transition = o;
elm_object_signal_callback_add(o, "entrance,wallpaper,end", "",
_entrance_gui_user_bg_cb, screen);
ol = entrance_gui_theme_get(_gui->win, "entrance");
screen->edj = ol;
if (!ol)
@ -379,6 +382,31 @@ entrance_gui_vkbd_enabled_get(void)
return _gui->vkbd_enabled;
}
void
entrance_gui_user_bg_set(const char *path, const char *group)
{
Eina_List *l;
Entrance_Screen *screen;
Evas_Object *o;
EINA_LIST_FOREACH(_gui->screens, l, screen)
{
if (path && group)
{
o = elm_layout_add(screen->background);
elm_layout_file_set(o, path, group);
elm_object_part_content_set(screen->transition,
"entrance.wallpaper.user.start", o);
evas_object_show(o);
elm_object_signal_emit(screen->transition,
"entrance,wallpaper,user", "");
}
else
elm_object_signal_emit(screen->transition,
"entrance,wallpaper,default", "");
}
}
static void
_entrance_gui_update(void)
{
@ -485,6 +513,7 @@ _entrance_gui_user_sel_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_
entrance_login_login_set(data, eu->login);
}
static char *
_entrance_gui_user_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
{
@ -610,6 +639,22 @@ _entrance_gui_auth_cb(void *data, const char *user EINA_UNUSED, Eina_Bool grante
*/
}
static void
_entrance_gui_user_bg_cb(void *data, Evas_Object *obj, const char *signal, const char *source)
{
Evas_Object *o;
Entrance_Screen *screen;
screen = data;
o = elm_object_part_content_get(screen->transition,
"entrance.wallpaper.user");
evas_object_del(o);
o = elm_object_part_content_get(screen->transition,
"entrance.wallpaper.user.start");
if (o)
elm_object_part_content_set(screen->transition,
"entrance.wallpaper.user", o);
}
static Eina_Bool
_entrance_gui_cb_window_property(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
{

View File

@ -24,6 +24,7 @@ void entrance_gui_theme_name_set(const char *theme);
void entrance_gui_background_get(const char **path, const char **group);
Eina_Bool entrance_gui_vkbd_enabled_get(void);
const char *entrance_gui_theme_path_get(void);
void entrance_gui_user_bg_set(const char *path, const char *group);
/*
char *entrance_gui_user_get();

View File

@ -331,11 +331,16 @@ _login_xsession_guess(void *data, const char *user)
if (!strcmp(eu->login, user))
{
_entrance_login_session_set(data, eu->lsess);
entrance_gui_user_bg_set(eu->bg.path, eu->bg.group);
break;
}
}
if (!l) _entrance_login_session_set(data, NULL);
if (!l)
{
_entrance_login_session_set(data, NULL);
entrance_gui_user_bg_set(NULL, NULL);
}
}
static void