[gnome-builder] libide/tweaks: subpages can contain groups



commit c47ca2226d9748b2813deb5e7c9b4219e8baf3e4
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jul 31 05:33:24 2022 -0700

    libide/tweaks: subpages can contain groups

 src/libide/tweaks/ide-tweaks-subpage.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/libide/tweaks/ide-tweaks-subpage.c b/src/libide/tweaks/ide-tweaks-subpage.c
index a5b4588f8..e04f8abc0 100644
--- a/src/libide/tweaks/ide-tweaks-subpage.c
+++ b/src/libide/tweaks/ide-tweaks-subpage.c
@@ -22,6 +22,7 @@
 
 #include "config.h"
 
+#include "ide-tweaks-group.h"
 #include "ide-tweaks-subpage.h"
 
 struct _IdeTweaksSubpage
@@ -46,6 +47,13 @@ ide_tweaks_subpage_new (void)
   return g_object_new (IDE_TYPE_TWEAKS_SUBPAGE, NULL);
 }
 
+static gboolean
+ide_tweaks_subpage_accepts (IdeTweaksItem *item,
+                            IdeTweaksItem *child)
+{
+  return IDE_IS_TWEAKS_GROUP (child);
+}
+
 static void
 ide_tweaks_subpage_dispose (GObject *object)
 {
@@ -98,11 +106,14 @@ static void
 ide_tweaks_subpage_class_init (IdeTweaksSubpageClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  IdeTweaksItemClass *item_class = IDE_TWEAKS_ITEM_CLASS (klass);
 
   object_class->dispose = ide_tweaks_subpage_dispose;
   object_class->get_property = ide_tweaks_subpage_get_property;
   object_class->set_property = ide_tweaks_subpage_set_property;
 
+  item_class->accepts = ide_tweaks_subpage_accepts;
+
   properties [PROP_TITLE] =
     g_param_spec_string ("title", NULL, NULL, NULL,
                          (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));


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