inspector: Don't derive from GtkBox

We don't do that anymore. A bin layout
is sufficient here.
This commit is contained in:
Matthias Clasen 2020-07-15 21:22:21 -04:00
parent f280508209
commit 594ec3d822
3 changed files with 8 additions and 5 deletions

View File

@ -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:

View File

@ -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))

View File

@ -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>