[gtk/bin-removal: 55/59] inspector: Derive recorder from GtkWidget



commit 3b33aeed6d8a48cfcc02fb64609146b3563a0235
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 3 19:31:11 2020 -0400

    inspector: Derive recorder from GtkWidget

 gtk/inspector/recorder.c  | 7 +++++--
 gtk/inspector/recorder.h  | 6 +++---
 gtk/inspector/recorder.ui | 2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index af212bed91..da78f3b6e9 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -19,6 +19,7 @@
 
 #include "recorder.h"
 
+#include <gtk/gtkbinlayout.h>
 #include <gtk/gtkbox.h>
 #include <gtk/gtkfilechooserdialog.h>
 #include <gtk/gtklabel.h>
@@ -72,7 +73,7 @@ enum
 
 static GParamSpec *props[LAST_PROP] = { NULL, };
 
-G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorRecorder, gtk_inspector_recorder, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorRecorder, gtk_inspector_recorder, GTK_TYPE_WIDGET)
 
 static GListModel *
 create_render_node_list_model (GskRenderNode **nodes,
@@ -330,7 +331,7 @@ create_widget_for_render_node (gpointer row_item,
       g_object_set_data_full (G_OBJECT (row), "make-sure-its-not-unreffed", g_object_ref (row_item), 
g_object_unref);
 
       arrow = gtk_builtin_icon_new ("expander");
-      gtk_container_add (GTK_CONTAINER (title), arrow);
+      gtk_button_set_child (GTK_BUTTON (title), arrow);
     }
   else
     {
@@ -1282,6 +1283,8 @@ gtk_inspector_recorder_class_init (GtkInspectorRecorderClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, render_node_list_selection_changed);
   gtk_widget_class_bind_template_callback (widget_class, render_node_save);
   gtk_widget_class_bind_template_callback (widget_class, node_property_activated);
+
+  gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
 }
 
 static void
diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h
index 945a198fe2..0d86641de6 100644
--- a/gtk/inspector/recorder.h
+++ b/gtk/inspector/recorder.h
@@ -18,7 +18,7 @@
 #ifndef _GTK_INSPECTOR_RECORDER_H_
 #define _GTK_INSPECTOR_RECORDER_H_
 
-#include <gtk/gtkbin.h>
+#include <gtk/gtkwidget.h>
 
 #define GTK_TYPE_INSPECTOR_RECORDER            (gtk_inspector_recorder_get_type())
 #define GTK_INSPECTOR_RECORDER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), 
GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorder))
@@ -32,12 +32,12 @@ typedef struct _GtkInspectorRecorderPrivate GtkInspectorRecorderPrivate;
 
 typedef struct _GtkInspectorRecorder
 {
-  GtkBin parent;
+  GtkWidget parent;
 } GtkInspectorRecorder;
 
 typedef struct _GtkInspectorRecorderClass
 {
-  GtkBinClass parent;
+  GtkWidgetClass parent;
 } GtkInspectorRecorderClass;
 
 G_BEGIN_DECLS
diff --git a/gtk/inspector/recorder.ui b/gtk/inspector/recorder.ui
index c3e6d2071e..364a4acac5 100644
--- a/gtk/inspector/recorder.ui
+++ b/gtk/inspector/recorder.ui
@@ -1,6 +1,6 @@
 <interface domain="gtk40">
   <object class="GListStore" id="recordings"/>
-  <template class="GtkInspectorRecorder" parent="GtkBin">
+  <template class="GtkInspectorRecorder" parent="GtkWidget">
     <child>
       <object class="GtkBox">
         <property name="orientation">vertical</property>


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