diff options
author | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-01-28 00:01:10 +0100 |
---|---|---|
committer | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-01-28 00:01:28 +0100 |
commit | 41406cf1a211cbb67c53b9275c4fe2c1046df254 (patch) | |
tree | 6c852d1682848d57ca1be20c0a83b6001ed595dd /garcon-gtk | |
parent | 1aa3f5f0234a244e1cb3456ade6d887b796c884f (diff) | |
download | garcon-41406cf1a211cbb67c53b9275c4fe2c1046df254.tar.gz |
Improve docstrings
Diffstat (limited to 'garcon-gtk')
-rw-r--r-- | garcon-gtk/garcon-gtk-menu.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/garcon-gtk/garcon-gtk-menu.c b/garcon-gtk/garcon-gtk-menu.c index 72e73ac..211be13 100644 --- a/garcon-gtk/garcon-gtk-menu.c +++ b/garcon-gtk/garcon-gtk-menu.c @@ -1184,7 +1184,7 @@ garcon_gtk_menu_set_show_tooltips (GarconGtkMenu *menu, * garcon_gtk_menu_get_show_tooltips: * @menu : A #GarconGtkMenu * - * Return value: if descriptions are shown in tooltip + * Return value: Whether descriptions are shown in the tooltip. **/ gboolean garcon_gtk_menu_get_show_tooltips (GarconGtkMenu *menu) @@ -1193,6 +1193,8 @@ garcon_gtk_menu_get_show_tooltips (GarconGtkMenu *menu) return menu->priv->show_tooltips; } + + /** * garcon_gtk_menu_set_show_desktop_actions: * @menu : A #GarconGtkMenu @@ -1220,7 +1222,7 @@ garcon_gtk_menu_set_show_desktop_actions (GarconGtkMenu *menu, * garcon_gtk_menu_get_show_desktop_actions: * @menu : A #GarconGtkMenu * - * Return value: if the desktop actions in a submenu + * Return value: Whether desktop actions are shown in a submenu. **/ gboolean garcon_gtk_menu_get_show_desktop_actions (GarconGtkMenu *menu) @@ -1230,10 +1232,39 @@ garcon_gtk_menu_get_show_desktop_actions (GarconGtkMenu *menu) } + +/** + * garcon_gtk_menu_get_desktop_actions_menu: + * @item : A #GarconMenuItem + * + * Return value: a #GtkMenu holding all actions described in the desktop file + * as menu items. Note that application icons are never shown on the + * action menu items. + **/ +GtkMenu * +garcon_gtk_menu_get_desktop_actions_menu (GarconMenuItem *item) +{ + GtkWidget *submenu = gtk_menu_new (); + GList *actions = NULL; + const gchar *parent_icon_name; + gboolean show_menu_icons = FALSE; + + actions = garcon_menu_item_get_actions (item); + g_return_val_if_fail (actions != NULL, NULL); + + parent_icon_name = garcon_menu_item_get_icon_name (item); + + garcon_gtk_menu_pack_actions_menu (submenu, item, actions, parent_icon_name, show_menu_icons); + + return submenu; +} + + + /** * garcon_gtk_menu_set_right_click_edits: * @menu : A #GarconGtkMenu - * @enable_right_click_edits : Toggle showing wether to launch an editor + * @enable_right_click_edits : Toggle showing whether to launch an editor * when the menu is clicked with the secondary mouse button. * **/ @@ -1258,7 +1289,7 @@ garcon_gtk_menu_set_right_click_edits (GarconGtkMenu *menu, * garcon_gtk_menu_get_right_click_edits: * @menu : A #GarconGtkMenu * - * Return value: if an editor will be launched on secondary mouse clicks. + * Return value: Whether an editor will be launched on secondary mouse clicks **/ gboolean garcon_gtk_menu_get_right_click_edits (GarconGtkMenu *menu) |