[gnome-builder] libide/tweaks: add switch item



commit 5d3bbb86d816153d4c0395ead4df21ce9e905a14
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 4 16:35:01 2022 -0700

    libide/tweaks: add switch item
    
     * Make IdeTweaksWidget abstract
     * Add IdeTweaksSwitch
     * Cleanup plumbing for all that
    
    We still need to create a settings binding so that we can bridge settings
    into actions for use by the actionable widgetry.

 src/libide/tweaks/demo/011-visual-style.ui    |   7 +-
 src/libide/tweaks/demo/041-code-language.ui   |   7 +
 src/libide/tweaks/ide-tweaks-init.c           |   1 +
 src/libide/tweaks/ide-tweaks-panel.c          |   2 +-
 src/libide/tweaks/ide-tweaks-switch.c         | 271 ++++++++++++++++++++++++++
 src/libide/tweaks/ide-tweaks-switch.h         |  55 ++++++
 src/libide/tweaks/ide-tweaks-widget-private.h |   2 +-
 src/libide/tweaks/ide-tweaks-widget.c         | 107 +---------
 src/libide/tweaks/ide-tweaks-widget.h         |  15 +-
 src/libide/tweaks/libide-tweaks.h             |   1 +
 src/libide/tweaks/meson.build                 |   2 +
 11 files changed, 350 insertions(+), 120 deletions(-)
---
diff --git a/src/libide/tweaks/demo/011-visual-style.ui b/src/libide/tweaks/demo/011-visual-style.ui
index e9cb522de..2c44b6f60 100644
--- a/src/libide/tweaks/demo/011-visual-style.ui
+++ b/src/libide/tweaks/demo/011-visual-style.ui
@@ -7,11 +7,6 @@
           <object class="IdeTweaksPage">
             <child internal-child="appearance_page_style_group">
               <object class="IdeTweaksGroup">
-                <child>
-                  <object class="IdeTweaksWidget">
-                    <property name="widget-type">GtkLabel</property>
-                  </object>
-                </child>
               </object>
             </child>
           </object>
@@ -19,4 +14,4 @@
       </object>
     </child>
   </template>
-</interface>
\ No newline at end of file
+</interface>
diff --git a/src/libide/tweaks/demo/041-code-language.ui b/src/libide/tweaks/demo/041-code-language.ui
index dca811c3e..dc200be62 100644
--- a/src/libide/tweaks/demo/041-code-language.ui
+++ b/src/libide/tweaks/demo/041-code-language.ui
@@ -12,6 +12,13 @@
                     <child>
                       <object class="IdeTweaksGroup" id="language_page_general_group">
                         <property name="title" translatable="yes">General</property>
+                        <child>
+                          <object class="IdeTweaksSwitch" id="language_page_general_group_trim_switch">
+                            <property name="title" translatable="yes">Trim Trailing Whitespace</property>
+                            <property name="subtitle" translatable="yes">Upon saving, trailing whitespace 
will be removed from modified lines</property>
+                            <property name="action-name" 
translatable="yes">settings:org.gnome.builder.editor.language.trim-trailing-whitespace</property>
+                          </object>
+                        </child>
                       </object>
                     </child>
                     <child>
diff --git a/src/libide/tweaks/ide-tweaks-init.c b/src/libide/tweaks/ide-tweaks-init.c
index 65fd41d3d..fbb125b1d 100644
--- a/src/libide/tweaks/ide-tweaks-init.c
+++ b/src/libide/tweaks/ide-tweaks-init.c
@@ -38,6 +38,7 @@ _ide_tweaks_init (void)
   g_type_ensure (IDE_TYPE_TWEAKS_ITEM);
   g_type_ensure (IDE_TYPE_TWEAKS_PAGE);
   g_type_ensure (IDE_TYPE_TWEAKS_SECTION);
+  g_type_ensure (IDE_TYPE_TWEAKS_SWITCH);
   g_type_ensure (IDE_TYPE_TWEAKS_VARIABLE);
   g_type_ensure (IDE_TYPE_TWEAKS_WIDGET);
   g_type_ensure (IDE_TYPE_TWEAKS_WINDOW);
diff --git a/src/libide/tweaks/ide-tweaks-panel.c b/src/libide/tweaks/ide-tweaks-panel.c
index 8a2a20ff4..6a8f36c71 100644
--- a/src/libide/tweaks/ide-tweaks-panel.c
+++ b/src/libide/tweaks/ide-tweaks-panel.c
@@ -70,7 +70,7 @@ ide_tweaks_panel_visitor_cb (IdeTweaksItem *item,
     }
   else if (IDE_IS_TWEAKS_WIDGET (item))
     {
-      GtkWidget *child = _ide_tweaks_widget_inflate (IDE_TWEAKS_WIDGET (item));
+      GtkWidget *child = _ide_tweaks_widget_create (IDE_TWEAKS_WIDGET (item));
 
       if (child == NULL)
         {
diff --git a/src/libide/tweaks/ide-tweaks-switch.c b/src/libide/tweaks/ide-tweaks-switch.c
new file mode 100644
index 000000000..e8e33d521
--- /dev/null
+++ b/src/libide/tweaks/ide-tweaks-switch.c
@@ -0,0 +1,271 @@
+/* ide-tweaks-switch.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "ide-tweaks-switch"
+
+#include "config.h"
+
+#include <adwaita.h>
+
+#include "ide-tweaks-switch.h"
+
+struct _IdeTweaksSwitch
+{
+  IdeTweaksWidget parent_instance;
+  char *title;
+  char *subtitle;
+  char *action_name;
+  GVariant *action_target;
+};
+
+enum {
+  PROP_0,
+  PROP_TITLE,
+  PROP_SUBTITLE,
+  PROP_ACTION_NAME,
+  PROP_ACTION_TARGET,
+  N_PROPS
+};
+
+G_DEFINE_FINAL_TYPE (IdeTweaksSwitch, ide_tweaks_switch, IDE_TYPE_TWEAKS_WIDGET)
+
+static GParamSpec *properties [N_PROPS];
+
+static GtkWidget *
+ide_tweaks_switch_create (IdeTweaksWidget *widget)
+{
+  IdeTweaksSwitch *self = (IdeTweaksSwitch *)widget;
+  AdwActionRow *row;
+  GtkSwitch *switch_;
+
+  g_assert (IDE_IS_TWEAKS_WIDGET (widget));
+
+  switch_ = g_object_new (GTK_TYPE_SWITCH,
+                          "valign", GTK_ALIGN_CENTER,
+                          "action-name", self->action_name,
+                          "action-target", self->action_target,
+                          NULL);
+  row = g_object_new (ADW_TYPE_ACTION_ROW,
+                      "title", self->title,
+                      "subtitle", self->subtitle,
+                      "activatable-widget", switch_,
+                      NULL);
+  adw_action_row_add_suffix (row, GTK_WIDGET (switch_));
+
+  return GTK_WIDGET (row);
+}
+
+static void
+ide_tweaks_switch_dispose (GObject *object)
+{
+  IdeTweaksSwitch *self = (IdeTweaksSwitch *)object;
+
+  g_clear_pointer (&self->title, g_free);
+  g_clear_pointer (&self->subtitle, g_free);
+  g_clear_pointer (&self->action_name, g_free);
+  g_clear_pointer (&self->action_target, g_variant_unref);
+
+  G_OBJECT_CLASS (ide_tweaks_switch_parent_class)->dispose (object);
+}
+
+static void
+ide_tweaks_switch_get_property (GObject    *object,
+                                guint       prop_id,
+                                GValue     *value,
+                                GParamSpec *pspec)
+{
+  IdeTweaksSwitch *self = IDE_TWEAKS_SWITCH (object);
+
+  switch (prop_id)
+    {
+    case PROP_ACTION_NAME:
+      g_value_set_string (value, ide_tweaks_switch_get_action_name (self));
+      break;
+
+    case PROP_ACTION_TARGET:
+      g_value_set_variant (value, ide_tweaks_switch_get_action_target (self));
+      break;
+
+    case PROP_SUBTITLE:
+      g_value_set_string (value, ide_tweaks_switch_get_subtitle (self));
+      break;
+
+    case PROP_TITLE:
+      g_value_set_string (value, ide_tweaks_switch_get_title (self));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+ide_tweaks_switch_set_property (GObject      *object,
+                                guint         prop_id,
+                                const GValue *value,
+                                GParamSpec   *pspec)
+{
+  IdeTweaksSwitch *self = IDE_TWEAKS_SWITCH (object);
+
+  switch (prop_id)
+    {
+    case PROP_ACTION_NAME:
+      ide_tweaks_switch_set_action_name (self, g_value_get_string (value));
+      break;
+
+    case PROP_ACTION_TARGET:
+      ide_tweaks_switch_set_action_target (self, g_value_get_variant (value));
+      break;
+
+    case PROP_SUBTITLE:
+      ide_tweaks_switch_set_subtitle (self, g_value_get_string (value));
+      break;
+
+    case PROP_TITLE:
+      ide_tweaks_switch_set_title (self, g_value_get_string (value));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+ide_tweaks_switch_class_init (IdeTweaksSwitchClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  IdeTweaksWidgetClass *widget_class = IDE_TWEAKS_WIDGET_CLASS (klass);
+
+  object_class->dispose = ide_tweaks_switch_dispose;
+  object_class->get_property = ide_tweaks_switch_get_property;
+  object_class->set_property = ide_tweaks_switch_set_property;
+
+  widget_class->create = ide_tweaks_switch_create;
+
+  properties[PROP_ACTION_NAME] =
+    g_param_spec_string ("action-name", NULL, NULL,
+                         NULL,
+                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
+
+  properties[PROP_ACTION_TARGET] =
+    g_param_spec_variant ("action-target", NULL, NULL,
+                          G_VARIANT_TYPE_ANY,
+                          NULL,
+                          (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
+
+  properties[PROP_SUBTITLE] =
+    g_param_spec_string ("subtitle", NULL, NULL,
+                         NULL,
+                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
+
+  properties[PROP_TITLE] =
+    g_param_spec_string ("title", NULL, NULL,
+                         NULL,
+                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_properties (object_class, N_PROPS, properties);
+}
+
+static void
+ide_tweaks_switch_init (IdeTweaksSwitch *self)
+{
+}
+
+const char *
+ide_tweaks_switch_get_action_name (IdeTweaksSwitch *self)
+{
+  g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
+
+  return self->action_name;
+}
+
+/**
+ * ide_tweaks_switch_get_action_target:
+ * @self: a #IdeTweaksSwitch
+ *
+ * Returns: (transfer none) (nullable): a #GVariant or %NULL
+ */
+GVariant *
+ide_tweaks_switch_get_action_target (IdeTweaksSwitch *self)
+{
+  g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
+
+  return self->action_target;
+}
+
+const char *
+ide_tweaks_switch_get_subtitle (IdeTweaksSwitch *self)
+{
+  g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
+
+  return self->subtitle;
+}
+
+const char *
+ide_tweaks_switch_get_title (IdeTweaksSwitch *self)
+{
+  g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
+
+  return self->title;
+}
+
+void
+ide_tweaks_switch_set_action_name (IdeTweaksSwitch *self,
+                                   const char      *action_name)
+{
+  g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
+
+  if (ide_set_string (&self->action_name, action_name))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ACTION_NAME]);
+}
+
+void
+ide_tweaks_switch_set_action_target (IdeTweaksSwitch *self,
+                                     GVariant        *action_target)
+{
+  g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
+
+  if (action_target == self->action_target)
+    return;
+
+  g_clear_pointer (&self->action_target, g_variant_unref);
+  self->action_target = action_target ? g_variant_ref_sink (action_target) : NULL;
+  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ACTION_TARGET]);
+}
+
+void
+ide_tweaks_switch_set_subtitle (IdeTweaksSwitch *self,
+                                   const char      *subtitle)
+{
+  g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
+
+  if (ide_set_string (&self->subtitle, subtitle))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SUBTITLE]);
+}
+
+void
+ide_tweaks_switch_set_title (IdeTweaksSwitch *self,
+                                   const char      *title)
+{
+  g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
+
+  if (ide_set_string (&self->title, title))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_TITLE]);
+}
diff --git a/src/libide/tweaks/ide-tweaks-switch.h b/src/libide/tweaks/ide-tweaks-switch.h
new file mode 100644
index 000000000..f2250edb1
--- /dev/null
+++ b/src/libide/tweaks/ide-tweaks-switch.h
@@ -0,0 +1,55 @@
+/* ide-tweaks-switch.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include "ide-tweaks-widget.h"
+
+G_BEGIN_DECLS
+
+#define IDE_TYPE_TWEAKS_SWITCH (ide_tweaks_switch_get_type())
+
+IDE_AVAILABLE_IN_ALL
+G_DECLARE_FINAL_TYPE (IdeTweaksSwitch, ide_tweaks_switch, IDE, TWEAKS_SWITCH, IdeTweaksWidget)
+
+IDE_AVAILABLE_IN_ALL
+IdeTweaksSwitch *ide_tweaks_switch_new               (void);
+IDE_AVAILABLE_IN_ALL
+const char      *ide_tweaks_switch_get_title         (IdeTweaksSwitch *self);
+IDE_AVAILABLE_IN_ALL
+void             ide_tweaks_switch_set_title         (IdeTweaksSwitch *self,
+                                                      const char      *title);
+IDE_AVAILABLE_IN_ALL
+const char      *ide_tweaks_switch_get_subtitle      (IdeTweaksSwitch *self);
+IDE_AVAILABLE_IN_ALL
+void             ide_tweaks_switch_set_subtitle      (IdeTweaksSwitch *self,
+                                                      const char      *subtitle);
+IDE_AVAILABLE_IN_ALL
+const char      *ide_tweaks_switch_get_action_name   (IdeTweaksSwitch *self);
+IDE_AVAILABLE_IN_ALL
+void             ide_tweaks_switch_set_action_name   (IdeTweaksSwitch *self,
+                                                      const char      *action_name);
+IDE_AVAILABLE_IN_ALL
+GVariant        *ide_tweaks_switch_get_action_target (IdeTweaksSwitch *self);
+IDE_AVAILABLE_IN_ALL
+void             ide_tweaks_switch_set_action_target (IdeTweaksSwitch *self,
+                                                      GVariant        *action_target);
+
+G_END_DECLS
diff --git a/src/libide/tweaks/ide-tweaks-widget-private.h b/src/libide/tweaks/ide-tweaks-widget-private.h
index f9be23f73..9fa1a5148 100644
--- a/src/libide/tweaks/ide-tweaks-widget-private.h
+++ b/src/libide/tweaks/ide-tweaks-widget-private.h
@@ -25,6 +25,6 @@
 
 G_BEGIN_DECLS
 
-GtkWidget *_ide_tweaks_widget_inflate (IdeTweaksWidget *self);
+GtkWidget *_ide_tweaks_widget_create (IdeTweaksWidget *self);
 
 G_END_DECLS
diff --git a/src/libide/tweaks/ide-tweaks-widget.c b/src/libide/tweaks/ide-tweaks-widget.c
index 4fdc61704..946647777 100644
--- a/src/libide/tweaks/ide-tweaks-widget.c
+++ b/src/libide/tweaks/ide-tweaks-widget.c
@@ -24,83 +24,11 @@
 
 #include "ide-tweaks-widget-private.h"
 
-struct _IdeTweaksWidget
-{
-  IdeTweaksItem parent_instance;
-  GType widget_type;
-};
-
-G_DEFINE_FINAL_TYPE (IdeTweaksWidget, ide_tweaks_widget, IDE_TYPE_TWEAKS_ITEM)
-
-enum {
-  PROP_0,
-  PROP_WIDGET_TYPE,
-  N_PROPS
-};
-
-static GParamSpec *properties [N_PROPS];
-
-static void
-ide_tweaks_widget_dispose (GObject *object)
-{
-  IdeTweaksWidget *self = (IdeTweaksWidget *)object;
-
-  G_OBJECT_CLASS (ide_tweaks_widget_parent_class)->dispose (object);
-}
-
-static void
-ide_tweaks_widget_get_property (GObject    *object,
-                                guint       prop_id,
-                                GValue     *value,
-                                GParamSpec *pspec)
-{
-  IdeTweaksWidget *self = IDE_TWEAKS_WIDGET (object);
-
-  switch (prop_id)
-    {
-    case PROP_WIDGET_TYPE:
-      g_value_set_gtype (value, ide_tweaks_widget_get_widget_type (self));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    }
-}
-
-static void
-ide_tweaks_widget_set_property (GObject      *object,
-                                guint         prop_id,
-                                const GValue *value,
-                                GParamSpec   *pspec)
-{
-  IdeTweaksWidget *self = IDE_TWEAKS_WIDGET (object);
-
-  switch (prop_id)
-    {
-    case PROP_WIDGET_TYPE:
-      ide_tweaks_widget_set_widget_type (self, g_value_get_gtype (value));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    }
-}
+G_DEFINE_ABSTRACT_TYPE (IdeTweaksWidget, ide_tweaks_widget, IDE_TYPE_TWEAKS_ITEM)
 
 static void
 ide_tweaks_widget_class_init (IdeTweaksWidgetClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  object_class->dispose = ide_tweaks_widget_dispose;
-  object_class->get_property = ide_tweaks_widget_get_property;
-  object_class->set_property = ide_tweaks_widget_set_property;
-
-  properties [PROP_WIDGET_TYPE] =
-    g_param_spec_gtype ("widget-type", NULL, NULL,
-                        GTK_TYPE_WIDGET,
-                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_properties (object_class, N_PROPS, properties);
 }
 
 static void
@@ -108,39 +36,10 @@ ide_tweaks_widget_init (IdeTweaksWidget *self)
 {
 }
 
-IdeTweaksWidget *
-ide_tweaks_widget_new (void)
-{
-  return g_object_new (IDE_TYPE_TWEAKS_WIDGET, NULL);
-}
-
-GType
-ide_tweaks_widget_get_widget_type (IdeTweaksWidget *self)
-{
-  g_return_val_if_fail (IDE_IS_TWEAKS_WIDGET (self), G_TYPE_INVALID);
-
-  return self->widget_type;
-}
-
-void
-ide_tweaks_widget_set_widget_type (IdeTweaksWidget *self,
-                                   GType            widget_type)
-{
-  g_return_if_fail (IDE_IS_TWEAKS_WIDGET (self));
-  g_return_if_fail (!widget_type || g_type_is_a (widget_type, GTK_TYPE_WIDGET));
-
-  if (self->widget_type != widget_type)
-    {
-      self->widget_type = widget_type;
-      g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_WIDGET_TYPE]);
-    }
-}
-
 GtkWidget *
-_ide_tweaks_widget_inflate (IdeTweaksWidget *self)
+_ide_tweaks_widget_create (IdeTweaksWidget *self)
 {
   g_return_val_if_fail (IDE_IS_TWEAKS_WIDGET (self), NULL);
-  g_return_val_if_fail (self->widget_type != G_TYPE_INVALID, NULL);
 
-  return g_object_new (self->widget_type, NULL);
+  return IDE_TWEAKS_WIDGET_GET_CLASS (self)->create (self);
 }
diff --git a/src/libide/tweaks/ide-tweaks-widget.h b/src/libide/tweaks/ide-tweaks-widget.h
index e825b494b..ec1725d8a 100644
--- a/src/libide/tweaks/ide-tweaks-widget.h
+++ b/src/libide/tweaks/ide-tweaks-widget.h
@@ -29,14 +29,13 @@ G_BEGIN_DECLS
 #define IDE_TYPE_TWEAKS_WIDGET (ide_tweaks_widget_get_type())
 
 IDE_AVAILABLE_IN_ALL
-G_DECLARE_FINAL_TYPE (IdeTweaksWidget, ide_tweaks_widget, IDE, TWEAKS_WIDGET, IdeTweaksItem)
+G_DECLARE_DERIVABLE_TYPE (IdeTweaksWidget, ide_tweaks_widget, IDE, TWEAKS_WIDGET, IdeTweaksItem)
 
-IDE_AVAILABLE_IN_ALL
-IdeTweaksWidget *ide_tweaks_widget_new             (void);
-IDE_AVAILABLE_IN_ALL
-GType            ide_tweaks_widget_get_widget_type (IdeTweaksWidget *self);
-IDE_AVAILABLE_IN_ALL
-void             ide_tweaks_widget_set_widget_type (IdeTweaksWidget *self,
-                                                    GType            widget_type);
+struct _IdeTweaksWidgetClass
+{
+  IdeTweaksItemClass parent_class;
+
+  GtkWidget *(*create) (IdeTweaksWidget *self);
+};
 
 G_END_DECLS
diff --git a/src/libide/tweaks/libide-tweaks.h b/src/libide/tweaks/libide-tweaks.h
index 982253dbd..b7fdb7d19 100644
--- a/src/libide/tweaks/libide-tweaks.h
+++ b/src/libide/tweaks/libide-tweaks.h
@@ -27,6 +27,7 @@
 # include "ide-tweaks-item.h"
 # include "ide-tweaks-page.h"
 # include "ide-tweaks-section.h"
+# include "ide-tweaks-switch.h"
 # include "ide-tweaks-variable.h"
 # include "ide-tweaks-widget.h"
 # include "ide-tweaks-window.h"
diff --git a/src/libide/tweaks/meson.build b/src/libide/tweaks/meson.build
index 289f73c8e..2b80c56ae 100644
--- a/src/libide/tweaks/meson.build
+++ b/src/libide/tweaks/meson.build
@@ -14,6 +14,7 @@ libide_tweaks_public_headers = [
   'ide-tweaks-item.h',
   'ide-tweaks-page.h',
   'ide-tweaks-section.h',
+  'ide-tweaks-switch.h',
   'ide-tweaks-variable.h',
   'ide-tweaks-widget.h',
   'ide-tweaks-window.h',
@@ -32,6 +33,7 @@ libide_tweaks_public_sources = [
   'ide-tweaks-group.c',
   'ide-tweaks-page.c',
   'ide-tweaks-section.c',
+  'ide-tweaks-switch.c',
   'ide-tweaks-variable.c',
   'ide-tweaks-widget.c',
   'ide-tweaks-window.c',


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