[gtksourceview/wip/chergert/snippets] add toggle for snippets to test widget
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/snippets] add toggle for snippets to test widget
- Date: Wed, 29 Jan 2020 15:43:32 +0000 (UTC)
commit 9a5feaf0cc9b5ae08e8ca4750d4eca587fe7e440
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 29 07:43:13 2020 -0800
add toggle for snippets to test widget
tests/test-widget.c | 9 +++++++++
tests/test-widget.ui | 11 +++++++++++
2 files changed, 20 insertions(+)
---
diff --git a/tests/test-widget.c b/tests/test-widget.c
index 45e99b7a..e928eb8b 100644
--- a/tests/test-widget.c
+++ b/tests/test-widget.c
@@ -307,6 +307,14 @@ show_right_margin_toggled_cb (TestWidget *self,
gtk_source_view_set_show_right_margin (self->priv->view, enabled);
}
+static void
+enable_snippets_toggled_cb (TestWidget *self,
+ GtkCheckButton *button)
+{
+ gboolean enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+ gtk_source_view_set_enable_snippets (self->priv->view, enabled);
+}
+
static void
right_margin_position_value_changed_cb (TestWidget *self,
GtkSpinButton *button)
@@ -969,6 +977,7 @@ test_widget_class_init (TestWidgetClass *klass)
gtk_widget_class_bind_template_callback (widget_class, backward_string_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, forward_string_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, smart_home_end_changed_cb);
+ gtk_widget_class_bind_template_callback (widget_class, enable_snippets_toggled_cb);
gtk_widget_class_bind_template_child_private (widget_class, TestWidget, view);
gtk_widget_class_bind_template_child_private (widget_class, TestWidget, map);
diff --git a/tests/test-widget.ui b/tests/test-widget.ui
index 834e0c1d..191d3441 100644
--- a/tests/test-widget.ui
+++ b/tests/test-widget.ui
@@ -214,6 +214,17 @@
</layout>
</object>
</child>
+ <child>
+ <object class="GtkCheckButton" id="enable_snippets">
+ <property name="label">Enable snippets</property>
+ <property name="can-focus">1</property>
+ <signal name="toggled" handler="enable_snippets_toggled_cb" object="TestWidget"
swapped="yes"/>
+ <layout>
+ <property name="top-attach">13</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
+ </child>
<child>
<object class="GtkGrid" id="grid10">
<layout>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]