[gtk/matthiasc/for-master: 15/17] inspector: Don't derive from GtkBox
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 15/17] inspector: Don't derive from GtkBox
- Date: Thu, 16 Jul 2020 11:14:44 +0000 (UTC)
commit 594ec3d8225f2f73269be3d9346a380b1f8300e6
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jul 15 21:22:21 2020 -0400
inspector: Don't derive from GtkBox
We don't do that anymore. A bin layout
is sufficient here.
gtk/inspector/resource-list.c | 9 ++++++---
gtk/inspector/resource-list.h | 2 +-
gtk/inspector/resource-list.ui | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gtk/inspector/resource-list.c b/gtk/inspector/resource-list.c
index e92f85e154..21e1096e34 100644
--- a/gtk/inspector/resource-list.c
+++ b/gtk/inspector/resource-list.c
@@ -30,6 +30,7 @@
#include "gtkeventcontrollerkey.h"
#include "gtkpicture.h"
#include "gtkmediafile.h"
+#include "gtkbinlayout.h"
#include "resource-holder.h"
#include <glib/gi18n-lib.h>
@@ -42,7 +43,7 @@ enum
struct _GtkInspectorResourceList
{
- GtkBox parent_instance;
+ GtkWidget parent_instance;
GtkTextBuffer *buffer;
GtkWidget *video;
@@ -71,11 +72,11 @@ struct _GtkInspectorResourceList
typedef struct _GtkInspectorResourceListClass
{
- GtkBoxClass parent;
+ GtkWidgetClass parent;
} GtkInspectorResourceListClass;
-G_DEFINE_TYPE (GtkInspectorResourceList, gtk_inspector_resource_list, GTK_TYPE_BOX)
+G_DEFINE_TYPE (GtkInspectorResourceList, gtk_inspector_resource_list, GTK_TYPE_WIDGET)
static GListModel *
load_resources_recurse (const char *path,
@@ -925,6 +926,8 @@ gtk_inspector_resource_list_class_init (GtkInspectorResourceListClass *klass)
gtk_widget_class_bind_template_callback (widget_class, bind_count_cb);
gtk_widget_class_bind_template_callback (widget_class, setup_size_cb);
gtk_widget_class_bind_template_callback (widget_class, bind_size_cb);
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
// vim: set et sw=2 ts=2:
diff --git a/gtk/inspector/resource-list.h b/gtk/inspector/resource-list.h
index d420c6e50d..9d4d98a0e4 100644
--- a/gtk/inspector/resource-list.h
+++ b/gtk/inspector/resource-list.h
@@ -18,7 +18,7 @@
#ifndef _GTK_INSPECTOR_RESOURCE_LIST_H_
#define _GTK_INSPECTOR_RESOURCE_LIST_H_
-#include <gtk/gtkbox.h>
+#include <gtk/gtkwidget.h>
#define GTK_TYPE_INSPECTOR_RESOURCE_LIST (gtk_inspector_resource_list_get_type())
#define GTK_INSPECTOR_RESOURCE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),
GTK_TYPE_INSPECTOR_RESOURCE_LIST, GtkInspectorResourceList))
diff --git a/gtk/inspector/resource-list.ui b/gtk/inspector/resource-list.ui
index 5bc39fbcdf..e393835baf 100644
--- a/gtk/inspector/resource-list.ui
+++ b/gtk/inspector/resource-list.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<object class="GtkTextBuffer" id="buffer"/>
- <template class="GtkInspectorResourceList" parent="GtkBox">
+ <template class="GtkInspectorResourceList" parent="GtkWidget">
<child>
<object class="GtkStack" id="stack">
<child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]