inspector: Remove menu special-casing

This commit is contained in:
Matthias Clasen 2019-12-27 08:48:03 -05:00
parent 7e8393ba0f
commit b59521bb82
2 changed files with 1 additions and 34 deletions

View File

@ -111,14 +111,6 @@ object_tree_widget_get_parent (GObject *object)
return G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (object)));
}
static GObject *
object_tree_menu_get_parent (GObject *object)
{
GtkWidget *w = gtk_menu_get_attach_widget (GTK_MENU (object));
return w ? G_OBJECT (w) : NULL;
}
static GListModel *
object_tree_widget_get_children (GObject *object)
{
@ -237,12 +229,6 @@ list_model_for_properties (GObject *object,
return result;
}
static GListModel *
object_tree_menu_item_get_children (GObject *object)
{
return list_model_for_properties (object, (const char *[2]) { "submenu", NULL });
}
static GListModel *
object_tree_combo_box_get_children (GObject *object)
{
@ -517,16 +503,6 @@ static const ObjectTreeClassFuncs object_tree_class_funcs[] = {
object_tree_widget_get_parent,
object_tree_combo_box_get_children
},
{
gtk_menu_item_get_type,
object_tree_widget_get_parent,
object_tree_menu_item_get_children
},
{
gtk_menu_get_type,
object_tree_menu_get_parent,
object_tree_widget_get_children
},
{
gtk_widget_get_type,
object_tree_widget_get_parent,

View File

@ -1251,15 +1251,6 @@ attribute_editor (GObject *object,
return box;
}
static GtkWidget *
action_ancestor (GtkWidget *widget)
{
if (GTK_IS_MENU (widget))
return gtk_menu_get_attach_widget (GTK_MENU (widget));
else
return gtk_widget_get_parent (widget);
}
static GObject *
find_action_owner (GtkActionable *actionable)
{
@ -1291,7 +1282,7 @@ find_action_owner (GtkActionable *actionable)
if (muxer && gtk_action_muxer_find (muxer, full_name, NULL))
return (GObject *)widget;
widget = action_ancestor (widget);
widget = gtk_widget_get_parent (widget);
}
return NULL;