From bfa0509f08b29bb833282b47e907686a8a44ef63 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 11 Nov 2019 11:58:43 +0100 Subject: [PATCH] Privatize popover menu pieces Don't allow manual creation of popover menus anymore. This lets us also make GtkModelButton private --- docs/reference/gtk/gtk4-docs.xml | 1 - docs/reference/gtk/gtk4-sections.txt | 22 +-- docs/reference/gtk/gtk4.types.in | 1 - gtk/gtk.h | 1 - gtk/gtkactionhelper.c | 2 +- gtk/gtkcolorswatch.c | 2 +- gtk/gtkfilechooserwidget.c | 2 +- gtk/gtkmenusectionbox.c | 4 +- gtk/gtkmodelbutton.c | 26 +++- ...kmodelbutton.h => gtkmodelbuttonprivate.h} | 15 +-- gtk/gtknotebook.c | 2 +- gtk/gtkplacessidebar.c | 2 +- gtk/gtkpopovermenu.c | 127 +++++++++--------- gtk/gtkpopovermenu.h | 11 +- gtk/gtkpopovermenubar.c | 27 ++-- gtk/gtkpopovermenuprivate.h | 10 +- gtk/gtktoolbar.c | 4 +- gtk/gtkwindow.c | 5 +- gtk/inspector/css-node-tree.c | 1 - gtk/meson.build | 1 - tests/testmodelbutton.c | 3 +- testsuite/gtk/notify.c | 4 - 22 files changed, 140 insertions(+), 133 deletions(-) rename gtk/{gtkmodelbutton.h => gtkmodelbuttonprivate.h} (87%) diff --git a/docs/reference/gtk/gtk4-docs.xml b/docs/reference/gtk/gtk4-docs.xml index 1835c7b1be..09205f766e 100644 --- a/docs/reference/gtk/gtk4-docs.xml +++ b/docs/reference/gtk/gtk4-docs.xml @@ -149,7 +149,6 @@ - diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 82a10b250e..6c19954b96 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -6546,18 +6546,14 @@ gtk_popover_get_type gtkpopovermenu GtkPopoverMenu GtkPopoverMenu -gtk_popover_menu_new gtk_popover_menu_new_from_model -gtk_popover_menu_add_submenu -gtk_popover_menu_open_submenu +gtk_popover_menu_set_menu_model +gtk_popover_menu_get_menu_model GTK_TYPE_POPOVER_MENU GTK_IS_POPOVER_MENU -GTK_IS_POPOVER_MENU_CLASS GTK_POPOVER_MENU -GTK_POPOVER_MENU_CLASS -GTK_POPOVER_MENU_GET_CLASS gtk_popover_menu_get_type @@ -6580,20 +6576,6 @@ GTK_POPOVER_MENU_BAR gtk_popover_menu_bar_get_type -
-gtkmodelbutton -GtkModelButton -GtkModelButton -GtkButtonRole -gtk_model_button_new - -GTK_TYPE_MODEL_BUTTON -GTK_MODEL_BUTTON -GTK_IS_MODEL_BUTTON - -gtk_model_button_get_type -
-
gtkeventcontroller GtkEventController diff --git a/docs/reference/gtk/gtk4.types.in b/docs/reference/gtk/gtk4.types.in index 23e796d637..b2c12bfdcf 100644 --- a/docs/reference/gtk/gtk4.types.in +++ b/docs/reference/gtk/gtk4.types.in @@ -121,7 +121,6 @@ gtk_menu_item_get_type gtk_menu_shell_get_type gtk_menu_tool_button_get_type gtk_message_dialog_get_type -gtk_model_button_get_type gtk_mount_operation_get_type gtk_native_get_type gtk_notebook_get_type diff --git a/gtk/gtk.h b/gtk/gtk.h index 4ce7e58098..270aad8c6b 100644 --- a/gtk/gtk.h +++ b/gtk/gtk.h @@ -162,7 +162,6 @@ #include #include #include -#include #include #include #include diff --git a/gtk/gtkactionhelper.c b/gtk/gtkactionhelper.c index c5f4356b2b..d36e285951 100644 --- a/gtk/gtkactionhelper.c +++ b/gtk/gtkactionhelper.c @@ -22,8 +22,8 @@ #include "gtkwidgetprivate.h" #include "gtkdebug.h" -#include "gtkmodelbutton.h" #include "gtktypebuiltins.h" +#include "gtkmodelbuttonprivate.h" #include diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index b44487774a..ea117d4f79 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -32,7 +32,7 @@ #include "gtkimage.h" #include "gtkintl.h" #include "gtkmain.h" -#include "gtkmodelbutton.h" +#include "gtkmodelbuttonprivate.h" #include "gtkpopovermenu.h" #include "gtkprivate.h" #include "gtksnapshot.h" diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 44056ec039..7ac3e20889 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -76,7 +76,7 @@ #include "gtkrevealer.h" #include "gtkspinner.h" #include "gtkseparator.h" -#include "gtkmodelbutton.h" +#include "gtkmodelbuttonprivate.h" #include "gtkgesturelongpress.h" #include "gtkgestureclick.h" #include "gtkeventcontrollerkey.h" diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c index 502de3ffc0..ed47c780ee 100644 --- a/gtk/gtkmenusectionbox.c +++ b/gtk/gtkmenusectionbox.c @@ -25,12 +25,12 @@ #include "gtkwidgetprivate.h" #include "gtklabel.h" #include "gtkmenutrackerprivate.h" -#include "gtkmodelbutton.h" +#include "gtkmodelbuttonprivate.h" #include "gtkseparator.h" #include "gtksizegroup.h" #include "gtkstack.h" #include "gtkstylecontext.h" -#include "gtkpopovermenu.h" +#include "gtkpopovermenuprivate.h" #include "gtkorientable.h" #include "gtkiconprivate.h" diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c index 984825a4f1..8d7bc1e408 100644 --- a/gtk/gtkmodelbutton.c +++ b/gtk/gtkmodelbutton.c @@ -19,7 +19,7 @@ #include "config.h" -#include "gtkmodelbutton.h" +#include "gtkmodelbuttonprivate.h" #include "gtkactionhelperprivate.h" #include "gtkboxlayout.h" @@ -182,6 +182,30 @@ static void gtk_model_button_actionable_iface_init (GtkActionableInterface *ifac G_DEFINE_TYPE_WITH_CODE (GtkModelButton, gtk_model_button, GTK_TYPE_WIDGET, G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIONABLE, gtk_model_button_actionable_iface_init)) +GType +gtk_button_role_get_type (void) +{ + static gsize gtk_button_role_type; + + if (g_once_init_enter (>k_button_role_type)) + { + static const GEnumValue values[] = { + { GTK_BUTTON_ROLE_NORMAL, "GTK_BUTTON_ROLE_NORMAL", "normal" }, + { GTK_BUTTON_ROLE_CHECK, "GTK_BUTTON_ROLE_CHECK", "check" }, + { GTK_BUTTON_ROLE_RADIO, "GTK_BUTTON_ROLE_RADIO", "radio" }, + { GTK_BUTTON_ROLE_TITLE, "GTK_BUTTON_ROLE_RADIO", "title" }, + { 0, NULL, NULL } + }; + GType type; + + type = g_enum_register_static (I_("GtkButtonRole"), values); + + g_once_init_leave (>k_button_role_type, type); + } + + return gtk_button_role_type; +} + enum { PROP_0, diff --git a/gtk/gtkmodelbutton.h b/gtk/gtkmodelbuttonprivate.h similarity index 87% rename from gtk/gtkmodelbutton.h rename to gtk/gtkmodelbuttonprivate.h index dde881da08..db10e01476 100644 --- a/gtk/gtkmodelbutton.h +++ b/gtk/gtkmodelbuttonprivate.h @@ -17,12 +17,8 @@ * Author: Matthias Clasen */ -#ifndef __GTK_MODEL_BUTTON_H__ -#define __GTK_MODEL_BUTTON_H__ - -#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) -#error "Only can be included directly." -#endif +#ifndef __GTK_MODEL_BUTTON_PRIVATE_H__ +#define __GTK_MODEL_BUTTON_PRIVATE_H__ #include @@ -52,12 +48,13 @@ typedef enum { GTK_BUTTON_ROLE_TITLE } GtkButtonRole; -GDK_AVAILABLE_IN_ALL +#define GTK_TYPE_BUTTON_ROLE (gtk_button_role_get_type ()) +GType gtk_button_role_get_type (void) G_GNUC_CONST; + GType gtk_model_button_get_type (void) G_GNUC_CONST; -GDK_AVAILABLE_IN_ALL GtkWidget * gtk_model_button_new (void); G_END_DECLS -#endif /* __GTK_MODEL_BUTTON_H__ */ +#endif /* __GTK_MODEL_BUTTON_PRIVATE_H__ */ diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 3c1509317f..9ce49dd93e 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -43,7 +43,7 @@ #include "gtklabel.h" #include "gtkmain.h" #include "gtkmarshalers.h" -#include "gtkpopovermenu.h" +#include "gtkpopovermenuprivate.h" #include "gtkorientable.h" #include "gtksizerequest.h" #include "gtkstylecontextprivate.h" diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 3989e52003..6b2ec5596e 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -59,7 +59,7 @@ #include "gtkentry.h" #include "gtkgesturelongpress.h" #include "gtkbox.h" -#include "gtkmodelbutton.h" +#include "gtkmodelbuttonprivate.h" #include "gtkprivate.h" #include "gtkeventcontrollerkey.h" #include "gtkgestureclick.h" diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c index 7b9d1d8733..369c9d6360 100644 --- a/gtk/gtkpopovermenu.c +++ b/gtk/gtkpopovermenu.c @@ -33,7 +33,7 @@ #include "gtkmain.h" #include "gtktypebuiltins.h" #include "gtkbindings.h" -#include "gtkmodelbutton.h" +#include "gtkmodelbuttonprivate.h" #include "gtkpopovermenubar.h" @@ -129,6 +129,8 @@ struct _GtkPopoverMenu GtkWidget *active_item; GtkWidget *open_submenu; GtkWidget *parent_menu; + GMenuModel *model; + GtkPopoverMenuFlags flags; }; struct _GtkPopoverMenuClass @@ -137,7 +139,8 @@ struct _GtkPopoverMenuClass }; enum { - PROP_VISIBLE_SUBMENU = 1 + PROP_VISIBLE_SUBMENU = 1, + PROP_MENU_MODEL }; G_DEFINE_TYPE (GtkPopoverMenu, gtk_popover_menu, GTK_TYPE_POPOVER) @@ -276,6 +279,16 @@ gtk_popover_menu_init (GtkPopoverMenu *popover) } +static void +gtk_popover_menu_dispose (GObject *object) +{ + GtkPopoverMenu *popover = GTK_POPOVER_MENU (object); + + g_clear_object (&popover->model); + + G_OBJECT_CLASS (gtk_popover_menu_parent_class)->dispose (object); +} + static void gtk_popover_menu_map (GtkWidget *widget) { @@ -290,47 +303,6 @@ gtk_popover_menu_unmap (GtkWidget *widget) gtk_popover_menu_open_submenu (GTK_POPOVER_MENU (widget), "main"); } -static void -gtk_popover_menu_add (GtkContainer *container, - GtkWidget *child) -{ - GtkWidget *stack; - - stack = gtk_bin_get_child (GTK_BIN (container)); - - if (stack == NULL) - { - GTK_CONTAINER_CLASS (gtk_popover_menu_parent_class)->add (container, child); - } - else - { - const char *name; - - if (gtk_widget_get_name (child)) - name = gtk_widget_get_name (child); - else if (gtk_stack_get_child_by_name (GTK_STACK (stack), "main")) - name = "submenu"; - else - name = "main"; - - gtk_popover_menu_add_submenu (GTK_POPOVER_MENU (container), child, name); - } -} - -static void -gtk_popover_menu_remove (GtkContainer *container, - GtkWidget *child) -{ - GtkWidget *stack; - - stack = gtk_bin_get_child (GTK_BIN (container)); - - if (child == stack) - GTK_CONTAINER_CLASS (gtk_popover_menu_parent_class)->remove (container, child); - else - gtk_container_remove (GTK_CONTAINER (stack), child); -} - static void gtk_popover_menu_get_property (GObject *object, guint property_id, @@ -347,6 +319,10 @@ gtk_popover_menu_get_property (GObject *object, g_value_set_string (value, gtk_stack_get_visible_child_name (GTK_STACK (stack))); break; + case PROP_MENU_MODEL: + g_value_set_object (value, gtk_popover_menu_get_menu_model (GTK_POPOVER_MENU (object))); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -369,6 +345,10 @@ gtk_popover_menu_set_property (GObject *object, gtk_stack_set_visible_child_name (GTK_STACK (stack), g_value_get_string (value)); break; + case PROP_MENU_MODEL: + gtk_popover_menu_set_menu_model (GTK_POPOVER_MENU (object), g_value_get_object (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -470,11 +450,11 @@ add_arrow_bindings (GtkBindingSet *binding_set, static void gtk_popover_menu_class_init (GtkPopoverMenuClass *klass) { - GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkBindingSet *binding_set; + object_class->dispose = gtk_popover_menu_dispose; object_class->set_property = gtk_popover_menu_set_property; object_class->get_property = gtk_popover_menu_get_property; @@ -482,9 +462,6 @@ gtk_popover_menu_class_init (GtkPopoverMenuClass *klass) widget_class->unmap = gtk_popover_menu_unmap; widget_class->focus = gtk_popover_menu_focus; - container_class->add = gtk_popover_menu_add; - container_class->remove = gtk_popover_menu_remove; - g_object_class_install_property (object_class, PROP_VISIBLE_SUBMENU, g_param_spec_string ("visible-submenu", @@ -493,6 +470,14 @@ gtk_popover_menu_class_init (GtkPopoverMenuClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (object_class, + PROP_MENU_MODEL, + g_param_spec_object ("menu-model", + P_("Menu model"), + P_("The model from which the menu is made."), + G_TYPE_MENU_MODEL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + binding_set = gtk_binding_set_by_class (klass); add_arrow_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP); @@ -567,14 +552,6 @@ gtk_popover_menu_open_submenu (GtkPopoverMenu *popover, gtk_stack_set_visible_child_name (GTK_STACK (stack), name); } -/** - * gtk_popover_menu_add_submenu: - * @popover: a #GtkPopoverMenu - * @submenu: a widget to add as submenu - * @name: the name for the submenu - * - * Adds a submenu to the popover menu. - */ void gtk_popover_menu_add_submenu (GtkPopoverMenu *popover, GtkWidget *submenu, @@ -583,14 +560,13 @@ gtk_popover_menu_add_submenu (GtkPopoverMenu *popover, GtkWidget *stack; stack = gtk_bin_get_child (GTK_BIN (popover)); - gtk_stack_add_named (GTK_STACK (stack), submenu, name); } /** * gtk_popover_menu_new_from_model: * @relative_to: (allow-none): #GtkWidget the popover is related to - * @model: a #GMenuModel + * @model: (allow-none): a #GMenuModel, or %NULL * * Creates a #GtkPopoverMenu and populates it according to * @model. The popover is pointed to the @relative_to widget. @@ -638,7 +614,7 @@ gtk_popover_menu_new_from_model (GtkWidget *relative_to, * #GTK_POPOVER_MENU_NESTED, which makes GTK create traditional, * nested submenus instead of the default sliding submenus. * - * Returns: the new #GtkPopoverMenu + * Returns: (transfer full): the new #GtkPopoverMenu */ GtkWidget * gtk_popover_menu_new_from_model_full (GtkWidget *relative_to, @@ -648,11 +624,42 @@ gtk_popover_menu_new_from_model_full (GtkWidget *relative_to, GtkWidget *popover; g_return_val_if_fail (relative_to == NULL || GTK_IS_WIDGET (relative_to), NULL); - g_return_val_if_fail (G_IS_MENU_MODEL (model), NULL); + g_return_val_if_fail (model == NULL || G_IS_MENU_MODEL (model), NULL); popover = gtk_popover_menu_new (relative_to); - gtk_menu_section_box_new_toplevel (GTK_POPOVER_MENU (popover), model, flags); + GTK_POPOVER_MENU (popover)->flags = flags; + gtk_popover_menu_set_menu_model (GTK_POPOVER_MENU (popover), model); return popover; } +void +gtk_popover_menu_set_menu_model (GtkPopoverMenu *popover, + GMenuModel *model) +{ + g_return_if_fail (GTK_IS_POPOVER_MENU (popover)); + g_return_if_fail (model == NULL || G_IS_MENU_MODEL (model)); + + if (g_set_object (&popover->model, model)) + { + GtkWidget *stack; + GtkWidget *child; + + stack = gtk_bin_get_child (GTK_BIN (popover)); + while ((child = gtk_widget_get_first_child (stack))) + gtk_widget_destroy (child); + + if (model) + gtk_menu_section_box_new_toplevel (popover, model, popover->flags); + + g_object_notify (G_OBJECT (popover), "menu-model"); + } +} + +GMenuModel * +gtk_popover_menu_get_menu_model (GtkPopoverMenu *popover) +{ + g_return_val_if_fail (GTK_IS_POPOVER_MENU (popover), NULL); + + return popover->model; +} diff --git a/gtk/gtkpopovermenu.h b/gtk/gtkpopovermenu.h index e2c1d3b3ef..af393143a2 100644 --- a/gtk/gtkpopovermenu.h +++ b/gtk/gtkpopovermenu.h @@ -35,9 +35,6 @@ typedef struct _GtkPopoverMenu GtkPopoverMenu; GDK_AVAILABLE_IN_ALL GType gtk_popover_menu_get_type (void) G_GNUC_CONST; -GDK_AVAILABLE_IN_ALL -GtkWidget * gtk_popover_menu_new (GtkWidget *relative_to); - GDK_AVAILABLE_IN_ALL GtkWidget * gtk_popover_menu_new_from_model (GtkWidget *relative_to, GMenuModel *model); @@ -61,12 +58,10 @@ GtkWidget * gtk_popover_menu_new_from_model_full (GtkWidget *relative_ GtkPopoverMenuFlags flags); GDK_AVAILABLE_IN_ALL -void gtk_popover_menu_add_submenu (GtkPopoverMenu *popover, - GtkWidget *submenu, - const char *name); +void gtk_popover_menu_set_menu_model (GtkPopoverMenu *popover, + GMenuModel *model); GDK_AVAILABLE_IN_ALL -void gtk_popover_menu_open_submenu (GtkPopoverMenu *popover, - const char *name); +GMenuModel *gtk_popover_menu_get_menu_model (GtkPopoverMenu *popover); G_END_DECLS diff --git a/gtk/gtkpopovermenubar.c b/gtk/gtkpopovermenubar.c index 031bb60c80..fab899bcf8 100644 --- a/gtk/gtkpopovermenubar.c +++ b/gtk/gtkpopovermenubar.c @@ -533,7 +533,7 @@ gtk_popover_menu_bar_init (GtkPopoverMenuBar *bar) /** * gtk_popover_menu_bar_new_from_model: - * @model: a #GMenuModel + * @model: (allow-none): a #GMenuModel, or %NULL * * Creates a #GtkPopoverMenuBar from a #GMenuModel. * @@ -550,7 +550,7 @@ gtk_popover_menu_bar_new_from_model (GMenuModel *model) /** * gtk_popover_menu_bar_set_menu_model: * @bar: a #GtkPopoverMenuBar - * @model: a #GMenuModel + * @model: (allow-none): a #GMenuModel, or %NULL * * Sets a menu model from which @bar should take * its contents. @@ -572,16 +572,19 @@ gtk_popover_menu_bar_set_menu_model (GtkPopoverMenuBar *bar, g_clear_pointer (&bar->tracker, gtk_menu_tracker_free); - muxer = _gtk_widget_get_action_muxer (GTK_WIDGET (bar), TRUE); - bar->tracker = gtk_menu_tracker_new (GTK_ACTION_OBSERVABLE (muxer), - model, - FALSE, - TRUE, - FALSE, - NULL, - tracker_insert, - tracker_remove, - bar); + if (model) + { + muxer = _gtk_widget_get_action_muxer (GTK_WIDGET (bar), TRUE); + bar->tracker = gtk_menu_tracker_new (GTK_ACTION_OBSERVABLE (muxer), + model, + FALSE, + TRUE, + FALSE, + NULL, + tracker_insert, + tracker_remove, + bar); + } g_object_notify_by_pspec (G_OBJECT (bar), bar_props[PROP_MENU_MODEL]); } diff --git a/gtk/gtkpopovermenuprivate.h b/gtk/gtkpopovermenuprivate.h index 898dc60f30..b0062cf560 100644 --- a/gtk/gtkpopovermenuprivate.h +++ b/gtk/gtkpopovermenuprivate.h @@ -32,6 +32,14 @@ GtkWidget *gtk_popover_menu_get_parent_menu (GtkPopoverMenu *menu); void gtk_popover_menu_set_parent_menu (GtkPopoverMenu *menu, GtkWidget *parent); +GtkWidget * gtk_popover_menu_new (GtkWidget *relative_to); + +void gtk_popover_menu_add_submenu (GtkPopoverMenu *popover, + GtkWidget *submenu, + const char *name); +void gtk_popover_menu_open_submenu (GtkPopoverMenu *popover, + const gchar *name); + G_END_DECLS -#endif /* __GTK_POPOVER_PRIVATE_H__ */ +#endif /* __GTK_POPOVER_MENU_PRIVATE_H__ */ diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 6d6d88e1ed..102fffd1cb 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -48,8 +48,8 @@ #include "gtkorientable.h" #include "gtkorientableprivate.h" #include "gtkprivate.h" -#include "gtkpopovermenu.h" -#include "gtkmodelbutton.h" +#include "gtkpopovermenuprivate.h" +#include "gtkmodelbuttonprivate.h" #include "gtkseparator.h" #include "gtkradiomenuitem.h" #include "gtkcheckmenuitem.h" diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 4891a36167..71e4e7a2af 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -59,9 +59,8 @@ #include "gtkmenubarprivate.h" #include "gtkmenushellprivate.h" #include "gtkpointerfocusprivate.h" -#include "gtkpopoverprivate.h" -#include "gtkpopovermenu.h" -#include "gtkmodelbutton.h" +#include "gtkpopovermenuprivate.h" +#include "gtkmodelbuttonprivate.h" #include "gtkseparator.h" #include "gtkprivate.h" #include "gtkroot.h" diff --git a/gtk/inspector/css-node-tree.c b/gtk/inspector/css-node-tree.c index 9926faf8f9..a95bb84092 100644 --- a/gtk/inspector/css-node-tree.c +++ b/gtk/inspector/css-node-tree.c @@ -40,7 +40,6 @@ #include "gtktreeview.h" #include "gtktreeselection.h" #include "gtktypebuiltins.h" -#include "gtkmodelbutton.h" #include "gtkstack.h" #include diff --git a/gtk/meson.build b/gtk/meson.build index 65576f92c6..326dd76ca5 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -552,7 +552,6 @@ gtk_public_headers = files([ 'gtkmenushell.h', 'gtkmenutoolbutton.h', 'gtkmessagedialog.h', - 'gtkmodelbutton.h', 'gtkmountoperation.h', 'gtknative.h', 'gtknativedialog.h', diff --git a/tests/testmodelbutton.c b/tests/testmodelbutton.c index 62ef324604..bea494faa6 100644 --- a/tests/testmodelbutton.c +++ b/tests/testmodelbutton.c @@ -1,4 +1,5 @@ #include +#include "gtk/gtkmodelbuttonprivate.h" static void on_action_beep (GSimpleAction *action, @@ -46,7 +47,7 @@ on_application_activate (GApplication *gapplication, gicon = g_themed_icon_new ("face-smile"); - model_button = g_object_new (GTK_TYPE_MODEL_BUTTON, + model_button = g_object_new (g_type_from_name ("GtkModelButton"), "action-name", "app.beep", "text", "It’s-a-me! ModelButton", "icon", gicon, diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 4a845ed447..52ffb0c30c 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -592,10 +592,6 @@ test_type (gconstpointer data) g_str_equal (pspec->name, "use-header-bar")) continue; - if (type == GTK_TYPE_MODEL_BUTTON && - pspec->owner_type == GTK_TYPE_BUTTON) - continue; - if (g_type_is_a (type, GTK_TYPE_SHORTCUTS_SHORTCUT) && g_str_equal (pspec->name, "accelerator")) continue;