[gnome-builder/gnome-builder-43] libide/gui: add missing new-frame action
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-43] libide/gui: add missing new-frame action
- Date: Wed, 21 Sep 2022 18:26:21 +0000 (UTC)
commit 909365e0977a5db4989a4f2d4c889896bd9dc5f1
Author: Christian Hergert <chergert redhat com>
Date: Wed Sep 21 11:25:37 2022 -0700
libide/gui: add missing new-frame action
src/libide/gui/ide-page.c | 30 ++++++++++++++++++++++++++++++
src/plugins/editorui/gtk/menus.ui | 4 ++--
2 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/gui/ide-page.c b/src/libide/gui/ide-page.c
index c9a45e3ba..79d7a786d 100644
--- a/src/libide/gui/ide-page.c
+++ b/src/libide/gui/ide-page.c
@@ -194,6 +194,8 @@ open_in_new_workspace_action (GtkWidget *widget,
workbench = ide_widget_get_workbench (GTK_WIDGET (self));
workspace = _ide_workbench_create_secondary (workbench);
+ position = panel_position_new ();
+
ide_workspace_add_page (IDE_WORKSPACE (workspace), IDE_PAGE (split), position);
gtk_window_present (GTK_WINDOW (workspace));
@@ -201,6 +203,33 @@ open_in_new_workspace_action (GtkWidget *widget,
IDE_EXIT;
}
+static void
+open_in_new_frame_action (GtkWidget *widget,
+ const char *action_name,
+ GVariant *param)
+{
+ IdePage *self = (IdePage *)widget;
+ g_autoptr(PanelPosition) position = NULL;
+ IdeWorkspace *workspace;
+ IdePage *split;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_PAGE (self));
+
+ if (!(split = ide_page_create_split (self)))
+ IDE_EXIT;
+
+ workspace = ide_widget_get_workspace (GTK_WIDGET (self));
+ position = panel_widget_get_position (PANEL_WIDGET (self));
+ panel_position_set_column (position, panel_position_get_column (position) + 1);
+
+ ide_workspace_add_page (IDE_WORKSPACE (workspace), IDE_PAGE (split), position);
+
+ IDE_EXIT;
+}
+
+
static void
ide_page_finalize (GObject *object)
{
@@ -330,6 +359,7 @@ ide_page_class_init (IdePageClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, IdePage, progress_bar);
panel_widget_class_install_action (panel_widget_class, "open-in-new-workspace", NULL,
open_in_new_workspace_action);
+ panel_widget_class_install_action (panel_widget_class, "open-in-new-frame", NULL,
open_in_new_frame_action);
}
static void
diff --git a/src/plugins/editorui/gtk/menus.ui b/src/plugins/editorui/gtk/menus.ui
index d9208f365..bf23f1948 100644
--- a/src/plugins/editorui/gtk/menus.ui
+++ b/src/plugins/editorui/gtk/menus.ui
@@ -140,8 +140,8 @@
<section id="ide-editor-page-document-section">
<item>
<attribute name="label" translatable="yes">Open in New Frame</attribute>
- <attribute name="id">editor-document-open-in-new-workspace</attribute>
- <attribute name="action">editorui.open-in-new-frame</attribute>
+ <attribute name="id">editor-document-open-in-new-frame</attribute>
+ <attribute name="action">page.open-in-new-frame</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open in New Workspace…</attribute>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]