[gnome-builder/wip/chergert/grep: 5/15] grep: allow closing the dialog



commit 59fee2a925d765759520c44630561f9a13672b4b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 26 18:15:41 2018 -0700

    grep: allow closing the dialog

 src/plugins/grep/gbp-grep-panel.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/plugins/grep/gbp-grep-panel.c b/src/plugins/grep/gbp-grep-panel.c
index 4ca029988..c91d60db7 100644
--- a/src/plugins/grep/gbp-grep-panel.c
+++ b/src/plugins/grep/gbp-grep-panel.c
@@ -34,6 +34,7 @@ struct _GbpGrepPanel
   GtkTreeView       *tree_view;
   GtkTreeViewColumn *toggle_column;
   GtkCheckButton    *check;
+  GtkButton         *close_button;
 };
 
 enum {
@@ -346,6 +347,7 @@ gbp_grep_panel_class_init (GbpGrepPanelClass *klass)
 
   gtk_widget_class_set_css_name (widget_class, "gbpgreppanel");
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/builder/plugins/grep/gbp-grep-panel.ui");
+  gtk_widget_class_bind_template_child (widget_class, GbpGrepPanel, close_button);
   gtk_widget_class_bind_template_child (widget_class, GbpGrepPanel, tree_view);
 }
 
@@ -357,6 +359,12 @@ gbp_grep_panel_init (GbpGrepPanel *self)
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
+  g_signal_connect_object (self->close_button,
+                           "clicked",
+                           G_CALLBACK (gtk_widget_destroy),
+                           self,
+                           G_CONNECT_SWAPPED);
+
   g_signal_connect_object (self->tree_view,
                            "row-activated",
                            G_CALLBACK (gbp_grep_panel_row_activated_cb),


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