[gnome-builder/wip/gtk4-port: 270/736] libide/gui: add IdePanel destroy helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 270/736] libide/gui: add IdePanel destroy helper
- Date: Tue, 26 Apr 2022 01:46:21 +0000 (UTC)
commit 834c0aa917681ff883e4410e3137f0acbda72b5a
Author: Christian Hergert <chergert redhat com>
Date: Thu Mar 31 02:14:09 2022 -0700
libide/gui: add IdePanel destroy helper
It can be convenient to destroy them directly like we do for windows and
other things that are semi-isolated.
src/libide/gui/ide-pane.c | 11 +++++++++++
src/libide/gui/ide-pane.h | 4 +++-
2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-pane.c b/src/libide/gui/ide-pane.c
index 5b3cf4987..fb4532bce 100644
--- a/src/libide/gui/ide-pane.c
+++ b/src/libide/gui/ide-pane.c
@@ -50,3 +50,14 @@ ide_pane_new (void)
{
return g_object_new (IDE_TYPE_PANE, NULL);
}
+
+void
+ide_pane_destroy (IdePane *self)
+{
+ GtkWidget *frame;
+
+ g_return_if_fail (IDE_IS_PANE (self));
+
+ if ((frame = gtk_widget_get_ancestor (GTK_WIDGET (self), PANEL_TYPE_FRAME)))
+ panel_frame_remove (PANEL_FRAME (frame), PANEL_WIDGET (self));
+}
diff --git a/src/libide/gui/ide-pane.h b/src/libide/gui/ide-pane.h
index 46aaaecbd..7f52d5420 100644
--- a/src/libide/gui/ide-pane.h
+++ b/src/libide/gui/ide-pane.h
@@ -41,6 +41,8 @@ struct _IdePaneClass
};
IDE_AVAILABLE_IN_ALL
-GtkWidget *ide_pane_new (void);
+GtkWidget *ide_pane_new (void);
+IDE_AVAILABLE_IN_ALL
+void ide_pane_destroy (IdePane *self);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]