Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_menu.c 


Log Message:
Hide menu when non-selection click occurs.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_menu.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_menu.c  24 Oct 2005 04:19:11 -0000      1.11
+++ ewl_menu.c  26 Oct 2005 03:37:51 -0000      1.12
@@ -64,12 +64,13 @@
        ewl_window_pointer_grab_set(EWL_WINDOW(menu->base.popup), TRUE);
        ewl_window_borderless_set(EWL_WINDOW(menu->base.popup));
        ewl_widget_internal_set(menu->base.popup, TRUE);
-       ewl_widget_layer_set(menu->base.popup, 1000);
        ewl_widget_appearance_set(EWL_WIDGET(menu->base.popup), "menu");
        ewl_object_fill_policy_set(EWL_OBJECT(menu->base.popup),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(menu->base.popup),
                                 EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
+       ewl_callback_append(menu->base.popup, EWL_CALLBACK_MOUSE_DOWN,
+                           ewl_menu_hide_cb, NULL);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
@@ -163,3 +164,16 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
+void
+ewl_menu_hide_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
+                                       void *user_data __UNUSED__)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
+
+       if (w == ewl_embed_focused_widget_get(EWL_EMBED(w)))
+               ewl_widget_hide(w);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to