[gnome-builder/wip/gtk4-port: 604/736] plugins/terminal: use pane observation helpers
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 604/736] plugins/terminal: use pane observation helpers
- Date: Tue, 26 Apr 2022 01:46:32 +0000 (UTC)
commit 654d9af8e21297b891d6bbd957bb9780271df059
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 18 06:09:18 2022 -0700
plugins/terminal: use pane observation helpers
src/plugins/terminal/gbp-terminal-workspace-addin.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/terminal/gbp-terminal-workspace-addin.c
b/src/plugins/terminal/gbp-terminal-workspace-addin.c
index 3a7d2e4f8..df605d29b 100644
--- a/src/plugins/terminal/gbp-terminal-workspace-addin.c
+++ b/src/plugins/terminal/gbp-terminal-workspace-addin.c
@@ -226,12 +226,13 @@ on_run_manager_run (GbpTerminalWorkspaceAddin *self,
"manage-spawn", FALSE,
"pty", pty,
NULL);
- self->run_panel = g_object_new (IDE_TYPE_PANE,
+ ide_pane_observe (g_object_new (IDE_TYPE_PANE,
"child", self->run_terminal,
"expand", TRUE,
"icon-name", "builder-run-start-symbolic",
"title", _("Application Output"),
- NULL);
+ NULL),
+ &self->run_panel);
position = ide_panel_position_new ();
ide_panel_position_set_edge (position, PANEL_DOCK_POSITION_BOTTOM);
@@ -310,11 +311,13 @@ gbp_terminal_workspace_addin_load (IdeWorkspaceAddin *addin,
"respawn-on-exit", TRUE,
"visible", TRUE,
NULL);
- self->bottom_dock = g_object_new (IDE_TYPE_PANE,
- "title", _("Terminal"),
- "icon-name", "builder-terminal-symbolic",
- "child", self->bottom,
- NULL);
+ ide_pane_observe (g_object_new (IDE_TYPE_PANE,
+ "title", _("Terminal"),
+ "icon-name", "builder-terminal-symbolic",
+ "child", self->bottom,
+ NULL),
+ &self->bottom_dock);
+
ide_workspace_add_pane (workspace, IDE_PANE (self->bottom_dock), position);
workbench = ide_widget_get_workbench (GTK_WIDGET (workspace));
@@ -369,8 +372,8 @@ gbp_terminal_workspace_addin_unload (IdeWorkspaceAddin *addin,
for (guint i = 0; i < G_N_ELEMENTS (terminal_actions); i++)
g_action_map_remove_action (G_ACTION_MAP (workspace), terminal_actions[i].name);
- g_clear_pointer ((PanelWidget **)&self->bottom_dock, panel_widget_close);
- g_clear_pointer ((PanelWidget **)&self->run_panel, panel_widget_close);
+ ide_clear_pane (&self->bottom_dock);
+ ide_clear_pane (&self->run_panel);
self->bottom = NULL;
self->bottom_dock = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]