From e7e7eef7b9a8f1228f01d1e8a844b7858b9be402 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Fri, 6 Feb 2015 11:50:30 -0500 Subject: [PATCH] implement hiding of channel list if grid is clicked Signed-off-by: Chris Michael --- src/bin/channel.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/bin/channel.c b/src/bin/channel.c index beca49d..4e37160 100644 --- a/src/bin/channel.c +++ b/src/bin/channel.c @@ -23,6 +23,7 @@ struct _Channel Evas_Object *o_frame; Evas_Object *o_spacer; Evas_Object *o_list; + Evas_Object *o_dismiss; Eina_Bool visible : 1; } userlist; @@ -173,6 +174,21 @@ _cb_userlist_compare(const void *data1, const void *data2) return strcasecmp(label1, label2); } +static void +_cb_userlist_dismiss_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) +{ + _cb_userlist_go(data, NULL, NULL, NULL); +} + +static void +_cb_userlist_done(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED) +{ + Channel *chl; + + chl = data; + chl->userlist.o_dismiss = NULL; +} + static void _cb_options_done(void *data) { @@ -259,6 +275,20 @@ _channel_userlist_create(Channel *chl) chl->userlist.o_spacer = o; edje_object_part_swallow(chl->o_bg, "userlist.control", o); } + + if (!chl->userlist.o_dismiss) + { + chl->userlist.o_dismiss = + evas_object_rectangle_add(evas_object_evas_get(chl->o_base)); + evas_object_color_set(chl->userlist.o_dismiss, 0, 0, 0, 0); + evas_object_event_callback_add(chl->userlist.o_dismiss, + EVAS_CALLBACK_MOUSE_DOWN, + _cb_userlist_dismiss_mouse_down, chl); + edje_object_signal_callback_add(chl->o_base, "userlist,hide,done", + PACKAGE_NAME, _cb_userlist_done, chl); + edje_object_part_swallow(chl->o_base, "userlist.dismiss", + chl->userlist.o_dismiss); + } } /* external functions */