[gnome-builder] libide/gui: add grid make frame helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/gui: add grid make frame helper
- Date: Fri, 16 Sep 2022 05:50:42 +0000 (UTC)
commit d9ec0805bc66d2af30f0555a02e4b17b20157bc2
Author: Christian Hergert <chergert redhat com>
Date: Thu Sep 15 22:45:11 2022 -0700
libide/gui: add grid make frame helper
src/libide/gui/ide-grid.c | 29 +++++++++++++++++++++++++++++
src/libide/gui/ide-grid.h | 4 ++++
2 files changed, 33 insertions(+)
---
diff --git a/src/libide/gui/ide-grid.c b/src/libide/gui/ide-grid.c
index 990dc1613..dce3f24e7 100644
--- a/src/libide/gui/ide-grid.c
+++ b/src/libide/gui/ide-grid.c
@@ -212,3 +212,32 @@ ide_grid_get_page_position (IdeGrid *self,
}
}
}
+
+/**
+ * ide_grid_make_frame:
+ * @self: a #IdeGrid
+ * @column: the grid column index
+ * @row: the grid column row index
+ *
+ * Retrieves or creates a frame at the column/row position.
+ *
+ * Returns: (transfer none): an #IdeFrame
+ */
+IdeFrame *
+ide_grid_make_frame (IdeGrid *self,
+ guint column,
+ guint row)
+{
+ PanelGridColumn *grid_column;
+ PanelFrame *frame;
+
+ g_return_val_if_fail (IDE_IS_GRID (self), NULL);
+
+ grid_column = panel_grid_get_column (PANEL_GRID (self), column);
+ g_assert (PANEL_IS_GRID_COLUMN (grid_column));
+
+ frame = panel_grid_column_get_row (grid_column, row);
+ g_assert (IDE_IS_FRAME (frame));
+
+ return IDE_FRAME (frame);
+}
diff --git a/src/libide/gui/ide-grid.h b/src/libide/gui/ide-grid.h
index e15a86d4d..04a7c69bb 100644
--- a/src/libide/gui/ide-grid.h
+++ b/src/libide/gui/ide-grid.h
@@ -51,5 +51,9 @@ IDE_AVAILABLE_IN_ALL
void ide_grid_foreach_page (IdeGrid *self,
IdePageCallback callback,
gpointer user_data);
+IDE_AVAILABLE_IN_ALL
+IdeFrame *ide_grid_make_frame (IdeGrid *self,
+ guint column,
+ guint row);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]