2009-02-27 Alberto Garcia <agarcia@igalia.com>
authorAlberto Garcia <agarcia@igalia.com>
Fri, 27 Feb 2009 15:36:16 +0000 (15:36 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Fri, 27 Feb 2009 15:36:16 +0000 (15:36 +0000)
* doc/hildon-sections.txt
* src/hildon-app-menu.h
* src/hildon-app-menu.c (+hildon_app_menu_popup):
New function to pop up a HildonAppMenu

* src/hildon-stackable-window.c
(hildon_stackable_window_toggle_menu):
Use hildon_app_menu_popup() to show the menu.

ChangeLog
doc/hildon-sections.txt
src/hildon-app-menu.c
src/hildon-app-menu.h
src/hildon-stackable-window.c

index fff2001..6dfe251 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2009-02-27  Alberto Garcia  <agarcia@igalia.com>
 
+       * doc/hildon-sections.txt
+       * src/hildon-app-menu.h
+       * src/hildon-app-menu.c (+hildon_app_menu_popup):
+       New function to pop up a HildonAppMenu
+
+       * src/hildon-stackable-window.c
+       (hildon_stackable_window_toggle_menu):
+       Use hildon_app_menu_popup() to show the menu.
+
+2009-02-27  Alberto Garcia  <agarcia@igalia.com>
+
        * src/hildon-app-menu.c (hildon_app_menu_show)
        (hildon_app_menu_map, +hildon_app_menu_find_intruder): Hide the
        menu if there's another window between it and its parent window.
index 6428b03..82e5e6b 100644 (file)
@@ -358,6 +358,7 @@ hildon_app_menu_prepend
 hildon_app_menu_insert
 hildon_app_menu_reorder_child
 hildon_app_menu_add_filter
+hildon_app_menu_popup
 <SUBSECTION Standard>
 HILDON_APP_MENU
 HILDON_IS_APP_MENU
index efee3d6..28b09ba 100644 (file)
@@ -35,7 +35,7 @@
  * To use a #HildonAppMenu, add it to a #HildonStackableWindow using
  * hildon_stackable_window_set_main_menu(). The menu will appear when
  * the user presses the window title bar. Alternatively, you can show
- * it by hand using gtk_widget_show().
+ * it by hand using hildon_app_menu_popup().
  *
  * The menu will be automatically hidden when one of its buttons is
  * clicked. Use g_signal_connect_after() when connecting callbacks to
@@ -875,6 +875,25 @@ hildon_app_menu_repack_items                    (HildonAppMenu *menu,
     }
 }
 
+/**
+ * hildon_app_menu_popup:
+ * @menu: a #HildonAppMenu
+ * @parent_window: a #GtkWindow
+ *
+ * Displays a menu on top of a window and makes it available for
+ * selection.
+ **/
+void
+hildon_app_menu_popup                           (HildonAppMenu *menu,
+                                                 GtkWindow     *parent_window)
+{
+    g_return_if_fail (HILDON_IS_APP_MENU (menu));
+    g_return_if_fail (GTK_IS_WINDOW (parent_window));
+
+    hildon_app_menu_set_parent_window (menu, parent_window);
+    gtk_widget_show (GTK_WIDGET (menu));
+}
+
 static void
 hildon_app_menu_init                            (HildonAppMenu *menu)
 {
index e59267c..8962817 100644 (file)
@@ -88,6 +88,10 @@ void
 hildon_app_menu_add_filter                      (HildonAppMenu *menu,
                                                  GtkButton     *filter);
 
+void
+hildon_app_menu_popup                           (HildonAppMenu *menu,
+                                                 GtkWindow     *parent_window);
+
 G_END_DECLS
 
 #endif /* __HILDON_APP_MENU_H__ */
index 7191533..3cfe9da 100644 (file)
@@ -212,8 +212,7 @@ hildon_stackable_window_toggle_menu             (HildonWindow *self,
         if (GTK_WIDGET_MAPPED (GTK_WIDGET (menu_to_use))) {
             gtk_widget_hide (GTK_WIDGET (menu_to_use));
         } else {
-            hildon_app_menu_set_parent_window (menu_to_use, GTK_WINDOW (self));
-            gtk_widget_show (GTK_WIDGET (menu_to_use));
+            hildon_app_menu_popup (menu_to_use, GTK_WINDOW (self));
         }
 
         return TRUE;