[tepl] AmtkFactoryMenu: take into account the default-flags property



commit ad8f71c276e9f35c57d7020edf95037c094ad7be
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Jul 17 19:02:52 2017 +0200

    AmtkFactoryMenu: take into account the default-flags property

 amtk/amtk-factory-menu.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/amtk/amtk-factory-menu.c b/amtk/amtk-factory-menu.c
index c1219e9..f481341 100644
--- a/amtk/amtk-factory-menu.c
+++ b/amtk/amtk-factory-menu.c
@@ -88,8 +88,11 @@ amtk_factory_menu_new_with_default_application (void)
  * @factory: an #AmtkFactoryMenu.
  * @action_name: an action name.
  *
- * Creates a new #GtkMenuItem for @action_name. The #AmtkActionInfoCentralStore
- * must contain an #AmtkActionInfo for @action_name.
+ * Creates a new #GtkMenuItem for @action_name with the
+ * #AmtkFactory:default-flags.
+ *
+ * The #AmtkActionInfoCentralStore must contain an #AmtkActionInfo for
+ * @action_name.
  *
  * gtk_actionable_set_action_name() is called on the menu item with
  * @action_name. The label is set with the #GtkMenuItem:use-underline property
@@ -109,9 +112,14 @@ GtkWidget *
 amtk_factory_menu_create_menu_item (AmtkFactoryMenu *factory,
                                    const gchar     *action_name)
 {
-       return amtk_factory_menu_create_menu_item_full (factory,
-                                                       action_name,
-                                                       AMTK_FACTORY_FLAGS_NONE);
+       AmtkFactoryFlags default_flags;
+
+       g_return_val_if_fail (AMTK_IS_FACTORY_MENU (factory), NULL);
+       g_return_val_if_fail (action_name != NULL, NULL);
+
+       default_flags = amtk_factory_get_default_flags (AMTK_FACTORY (factory));
+
+       return amtk_factory_menu_create_menu_item_full (factory, action_name, default_flags);
 }
 
 /**
@@ -120,6 +128,9 @@ amtk_factory_menu_create_menu_item (AmtkFactoryMenu *factory,
  * @action_name: an action name.
  * @flags: #AmtkFactoryFlags.
  *
+ * This function ignores the #AmtkFactory:default-flags property and takes the
+ * @flags argument instead.
+ *
  * Returns: (transfer floating): a new #GtkMenuItem for @action_name.
  * Since: 3.0
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]