Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_popup.c ewl_popup.h ewl_menu.c 


Log Message:
- stop the short flickering of the popup
- place the menu on the correct position if the menubar is vertical

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_popup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_popup.c 5 Nov 2006 22:08:22 -0000       1.2
+++ ewl_popup.c 18 Nov 2006 14:45:14 -0000      1.3
@@ -61,7 +61,8 @@
        
        ewl_callback_append(w, EWL_CALLBACK_SHOW, ewl_popup_cb_show, NULL);
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_popup_cb_show, NULL);
-       ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_popup_cb_destroy, 
NULL);
+       ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_popup_cb_destroy, 
+                                                                       NULL);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
@@ -117,13 +118,19 @@
        if (p->follow == w)
                DRETURN(DLEVEL_STABLE);
        
-       if (p->follow)
+       if (p->follow) {
                ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY,
                                                ewl_popup_cb_follow_destroy, p);
-
-       if (w)
+               ewl_callback_del_with_data(p->follow, EWL_CALLBACK_CONFIGURE,
+                                               ewl_popup_cb_follow_configure,
+                                               p);
+       }
+       if (w) {
                ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, 
                                        ewl_popup_cb_follow_destroy, p);
+               ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
+                                       ewl_popup_cb_follow_configure, p);
+       }
 
        p->follow = w;
 
@@ -200,6 +207,30 @@
        if (p->follow)
                ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY,
                                        ewl_popup_cb_follow_destroy, p);
+
+        DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @internal
+ * @param w: UNUSED
+ * @param ev_data: UNUSED
+ * @param user_data: the popup
+ * @return Returns no value
+ * @brief The configure callback
+ */
+void
+ewl_popup_cb_follow_configure(Ewl_Widget *w __UNUSED__, 
+                               void *ev_data __UNUSED__, void *user_data)
+{
+        Ewl_Popup *p;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+        DCHECK_PARAM_PTR("user_data", user_data);
+        DCHECK_TYPE("user_data", user_data, EWL_POPUP_TYPE);
+
+       p = EWL_POPUP(user_data);
+       ewl_popup_position_check(p);
 
         DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_popup.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_popup.h 5 Nov 2006 22:08:22 -0000       1.2
+++ ewl_popup.h 18 Nov 2006 14:45:14 -0000      1.3
@@ -55,6 +55,8 @@
                                        Ewl_Orientation o);
 void ewl_popup_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
 void ewl_popup_cb_follow_destroy(Ewl_Widget *w, void *ev_data, void 
*user_data);
+void ewl_popup_cb_follow_configure(Ewl_Widget *w, void *ev_data, 
+                                       void *user_data);
 
 /**
  * @}
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_menu.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_menu.c  4 Nov 2006 16:58:05 -0000       1.35
+++ ewl_menu.c  18 Nov 2006 14:45:14 -0000      1.36
@@ -96,14 +96,18 @@
                                        void *user_data __UNUSED__)
 {
        Ewl_Menu *menu;
+       Ewl_Box *parent;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
        menu = EWL_MENU(w);
+       parent = EWL_BOX(menu->menubar_parent);
        
-       if (EWL_MENU_ITEM(menu)->inmenu) 
+       if ((parent && (ewl_box_orientation_get(parent) 
+                               == EWL_ORIENTATION_VERTICAL))
+               || EWL_MENU_ITEM(menu)->inmenu)
                ewl_popup_type_set(EWL_POPUP(menu->base.popup), 
                                        EWL_POPUP_TYPE_MENU_HORIZONTAL);
        else 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to