Commit 9822d510 authored by Matthias Clasen's avatar Matthias Clasen

GtkMenuButton: Support popovers

Add api to allow explicitly setting a GtkPopover instead of
a GtkMenu as the popup of a GtkMenuButton. Also, add api to
instruct the menu button to construct a popover when given
a menu model.

We set the style class "menu-button" on the button only when
it pops up a menu, to allow different treatment for the active
state of the button in the two cases.

https://bugzilla.gnome.org/show_bug.cgi?id=723878
parent 552c29b4
......@@ -2241,8 +2241,12 @@ GtkMenuButton
gtk_menu_button_new
gtk_menu_button_set_popup
gtk_menu_button_get_popup
gtk_menu_button_set_popover
gtk_menu_button_get_popover
gtk_menu_button_set_menu_model
gtk_menu_button_get_menu_model
gtk_menu_button_set_use_popover
gtk_menu_button_get_use_popover
gtk_menu_button_set_direction
gtk_menu_button_get_direction
gtk_menu_button_set_align_widget
......
This diff is collapsed.
......@@ -27,6 +27,7 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkmenu.h>
#include <gtk/gtkpopover.h>
G_BEGIN_DECLS
......@@ -67,10 +68,16 @@ GtkWidget *gtk_menu_button_new (void);
GDK_AVAILABLE_IN_3_6
void gtk_menu_button_set_popup (GtkMenuButton *menu_button,
GtkWidget *popup);
GtkWidget *menu);
GDK_AVAILABLE_IN_3_6
GtkMenu *gtk_menu_button_get_popup (GtkMenuButton *menu_button);
GDK_AVAILABLE_IN_3_12
void gtk_menu_button_set_popover (GtkMenuButton *menu_button,
GtkWidget *popover);
GDK_AVAILABLE_IN_3_12
GtkPopover *gtk_menu_button_get_popover (GtkMenuButton *menu_button);
GDK_AVAILABLE_IN_3_6
void gtk_menu_button_set_direction (GtkMenuButton *menu_button,
GtkArrowType direction);
......@@ -89,6 +96,14 @@ void gtk_menu_button_set_align_widget (GtkMenuButton *menu_button,
GDK_AVAILABLE_IN_3_6
GtkWidget *gtk_menu_button_get_align_widget (GtkMenuButton *menu_button);
GDK_AVAILABLE_IN_3_12
void gtk_menu_button_set_use_popover (GtkMenuButton *menu_button,
gboolean use_popover);
GDK_AVAILABLE_IN_3_12
gboolean gtk_menu_button_get_use_popover (GtkMenuButton *menu_button);
G_END_DECLS
#endif /* __GTK_MENU_BUTTON_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment