[gnome-builder/wip/gtk4-port: 478/736] libide/editor: implement create_split for editor page




commit f8c52ad71a068adb0ba2929b0745dca2564d7afb
Author: Christian Hergert <chergert redhat com>
Date:   Wed Apr 6 22:16:12 2022 -0700

    libide/editor: implement create_split for editor page

 src/libide/editor/ide-editor-page.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-page.c b/src/libide/editor/ide-editor-page.c
index 2acbe3c89..110c92087 100644
--- a/src/libide/editor/ide-editor-page.c
+++ b/src/libide/editor/ide-editor-page.c
@@ -215,6 +215,21 @@ ide_editor_page_root (GtkWidget *widget)
   IDE_EXIT;
 }
 
+static IdePage *
+ide_editor_page_create_split (IdePage *page)
+{
+  IdeEditorPage *self = (IdeEditorPage *)page;
+  GtkWidget *ret;
+
+  IDE_ENTRY;
+
+  g_assert (IDE_IS_EDITOR_PAGE (self));
+
+  ret = ide_editor_page_new (self->buffer);
+
+  IDE_RETURN (IDE_PAGE (ret));
+}
+
 static GFile *
 ide_editor_page_get_file_or_directory (IdePage *page)
 {
@@ -308,6 +323,7 @@ ide_editor_page_class_init (IdeEditorPageClass *klass)
   widget_class->root = ide_editor_page_root;
 
   page_class->get_file_or_directory = ide_editor_page_get_file_or_directory;
+  page_class->create_split = ide_editor_page_create_split;
 
   /**
    * IdeEditorPage:buffer:
@@ -356,6 +372,8 @@ ide_editor_page_init (IdeEditorPage *self)
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
+  ide_page_set_can_split (IDE_PAGE (self), TRUE);
+
   /* Load menus for editor pages */
   menu = ide_application_get_menu_by_id (IDE_APPLICATION_DEFAULT, "ide-editor-page-menu");
   panel_widget_set_menu_model (PANEL_WIDGET (self), G_MENU_MODEL (menu));


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