[sysprof/wip/gtk4-port] page: start porting to GTK 4



commit dfff61159bce9a0f8e6997e063f4ea3d6430432d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 28 16:02:43 2021 -0700

    page: start porting to GTK 4
    
    More work to be done, but setup the base object.

 src/libsysprof-ui/sysprof-page.c | 5 ++++-
 src/libsysprof-ui/sysprof-page.h | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-page.c b/src/libsysprof-ui/sysprof-page.c
index 36442762..afb46f45 100644
--- a/src/libsysprof-ui/sysprof-page.c
+++ b/src/libsysprof-ui/sysprof-page.c
@@ -31,7 +31,7 @@ typedef struct
   gchar *title;
 } SysprofPagePrivate;
 
-G_DEFINE_TYPE_WITH_PRIVATE (SysprofPage, sysprof_page, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_PRIVATE (SysprofPage, sysprof_page, GTK_TYPE_WIDGET)
 
 enum {
   PROP_0,
@@ -157,6 +157,7 @@ static void
 sysprof_page_class_init (SysprofPageClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->finalize = sysprof_page_finalize;
   object_class->get_property = sysprof_page_get_property;
@@ -173,6 +174,8 @@ sysprof_page_class_init (SysprofPageClass *klass)
                          (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_properties (object_class, N_PROPS, properties);
+
+  gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
 }
 
 static void
diff --git a/src/libsysprof-ui/sysprof-page.h b/src/libsysprof-ui/sysprof-page.h
index f8fc3b3b..22d55044 100644
--- a/src/libsysprof-ui/sysprof-page.h
+++ b/src/libsysprof-ui/sysprof-page.h
@@ -32,11 +32,11 @@ G_BEGIN_DECLS
 #define SYSPROF_TYPE_PAGE (sysprof_page_get_type())
 
 SYSPROF_AVAILABLE_IN_ALL
-G_DECLARE_DERIVABLE_TYPE (SysprofPage, sysprof_page, SYSPROF, PAGE, GtkBin)
+G_DECLARE_DERIVABLE_TYPE (SysprofPage, sysprof_page, SYSPROF, PAGE, GtkWidget)
 
 struct _SysprofPageClass
 {
-  GtkBinClass parent_class;
+  GtkWidgetClass parent_class;
 
   void     (*load_async)      (SysprofPage              *self,
                                SysprofCaptureReader     *reader,


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