mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
popovermenu: Add default sliding flag
Also add missing annotation. Continuation of https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6298
This commit is contained in:
parent
11dc15207e
commit
d05f47a695
@ -1803,16 +1803,19 @@ typedef enum { /*< prefix=GTK_ACCESSIBLE_SORT >*/
|
||||
|
||||
/**
|
||||
* GtkPopoverMenuFlags:
|
||||
* @GTK_POPOVER_MENU_NESTED: Create submenus as nested
|
||||
* popovers. Without this flag, submenus are created as
|
||||
* sliding pages that replace the main menu.
|
||||
* @GTK_POPOVER_MENU_SLIDING: Submenus are presented as sliding submenus that
|
||||
* replace the main menu.
|
||||
* @GTK_POPOVER_MENU_NESTED: Submenus are presented as traditional, nested
|
||||
* popovers.
|
||||
*
|
||||
* Flags that affect how [class@Gtk.PopoverMenu] widgets built from
|
||||
* a [class@Gio.MenuModel] are created and displayed.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
typedef enum { /*< prefix=GTK_POPOVER_MENU >*/
|
||||
GTK_POPOVER_MENU_SLIDING = 0,
|
||||
GTK_POPOVER_MENU_NESTED = 1 << 0
|
||||
} GtkPopoverMenuFlags;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -637,7 +637,8 @@ gtk_popover_menu_class_init (GtkPopoverMenuClass *klass)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FLAGS,
|
||||
g_param_spec_flags ("flags", NULL, NULL,
|
||||
GTK_TYPE_POPOVER_MENU_FLAGS, 0,
|
||||
GTK_TYPE_POPOVER_MENU_FLAGS,
|
||||
GTK_POPOVER_MENU_SLIDING,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
|
||||
| G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@ -783,7 +784,7 @@ GtkWidget *
|
||||
gtk_popover_menu_new_from_model (GMenuModel *model)
|
||||
|
||||
{
|
||||
return gtk_popover_menu_new_from_model_full (model, 0);
|
||||
return gtk_popover_menu_new_from_model_full (model, GTK_POPOVER_MENU_SLIDING);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -799,10 +800,6 @@ gtk_popover_menu_new_from_model (GMenuModel *model)
|
||||
* belongs. Actions can also be added using [method@Gtk.Widget.insert_action_group]
|
||||
* on the parent widget or on any of its parent widgets.
|
||||
*
|
||||
* The only flag that is supported currently is
|
||||
* %GTK_POPOVER_MENU_NESTED, which makes GTK create traditional,
|
||||
* nested submenus instead of the default sliding submenus.
|
||||
*
|
||||
* Returns: the new `GtkPopoverMenu`
|
||||
*/
|
||||
GtkWidget *
|
||||
|
Loading…
Reference in New Issue
Block a user