[gtk+/wip/baedert/drawing: 48/55] menuitem: Remove gadget



commit 93e4e0c9b789629967ed88a65adfca704d60daf4
Author: Timm Bäder <mail baedert org>
Date:   Sat May 6 14:17:45 2017 +0200

    menuitem: Remove gadget
    
    Now that GtkCheckMenuItem isn't using it anymore, we also don't need it.

 gtk/gtkmenuitem.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 0b179ec..a438a14 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -707,7 +707,6 @@ static void
 gtk_menu_item_init (GtkMenuItem *menu_item)
 {
   GtkMenuItemPrivate *priv;
-  GtkCssNode *widget_node;
 
   priv = gtk_menu_item_get_instance_private (menu_item);
   menu_item->priv = priv;
@@ -723,20 +722,6 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
     priv->submenu_direction = GTK_DIRECTION_RIGHT;
   priv->submenu_placement = GTK_TOP_BOTTOM;
   priv->timer = 0;
-
-  widget_node = gtk_widget_get_css_node (GTK_WIDGET (menu_item));
-  priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
-                                                     GTK_WIDGET (menu_item),
-                                                     NULL,
-                                                     NULL,
-                                                     NULL,
-                                                     NULL, NULL);
-}
-
-GtkCssGadget *
-_gtk_menu_item_get_gadget (GtkMenuItem *menu_item)
-{
-  return menu_item->priv->gadget;
 }
 
 /**
@@ -799,7 +784,6 @@ gtk_menu_item_dispose (GObject *object)
   g_clear_object (&priv->action_helper);
 
   g_clear_object (&priv->arrow_gadget);
-  g_clear_object (&priv->gadget);
 
   G_OBJECT_CLASS (gtk_menu_item_parent_class)->dispose (object);
 }
@@ -1009,8 +993,10 @@ update_arrow_gadget (GtkMenuItem *menu_item)
         {
           priv->arrow_gadget = gtk_builtin_icon_new ("arrow",
                                                      widget,
-                                                     priv->gadget,
+                                                     NULL,
                                                      NULL);
+          gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->arrow_gadget),
+                                   gtk_widget_get_css_node (widget));
           update_node_classes (menu_item);
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]