[gnome-builder/wip/gtk4-port] plugins/sysprof: implement split support for pages



commit 40dcd184f37ea94054fa21c75182f71bd8b4e506
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 17 16:57:13 2022 -0700

    plugins/sysprof: implement split support for pages
    
    This doesn't really get used yet, but trivial to have ready for when we
    might want to by moving to a new workspace, for example.

 src/plugins/sysprof/gbp-sysprof-page.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/plugins/sysprof/gbp-sysprof-page.c b/src/plugins/sysprof/gbp-sysprof-page.c
index 56e334943..c70e9b9bd 100644
--- a/src/plugins/sysprof/gbp-sysprof-page.c
+++ b/src/plugins/sysprof/gbp-sysprof-page.c
@@ -66,6 +66,18 @@ gbp_sysprof_page_set_file (GbpSysprofPage *self,
 
   g_set_object (&self->file, file);
   sysprof_display_open (self->display, file);
+  ide_page_set_can_split (IDE_PAGE (self), TRUE);
+}
+
+static IdePage *
+gbp_sysprof_page_create_split (IdePage *page)
+{
+  GbpSysprofPage *self = (GbpSysprofPage *)page;
+
+  g_assert (GBP_IS_SYSPROF_PAGE (page));
+  g_assert (G_IS_FILE (self->file));
+
+  return IDE_PAGE (gbp_sysprof_page_new_for_file (self->file));
 }
 
 static void
@@ -120,11 +132,14 @@ static void
 gbp_sysprof_page_class_init (GbpSysprofPageClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  IdePageClass *page_class = IDE_PAGE_CLASS (klass);
 
   object_class->dispose = gbp_sysprof_page_dispose;
   object_class->get_property = gbp_sysprof_page_get_property;
   object_class->set_property = gbp_sysprof_page_set_property;
 
+  page_class->create_split = gbp_sysprof_page_create_split;
+
   properties [PROP_FILE] =
     g_param_spec_object ("file", NULL, NULL,
                          G_TYPE_FILE,


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