[gtksourceview] Use an event box to avoid the source view from getting mouse events
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Use an event box to avoid the source view from getting mouse events
- Date: Wed, 31 Dec 2014 08:33:58 +0000 (UTC)
commit d477a4c020e1dd9afb08c2b58d89ef1299cfa0ce
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Dec 31 09:33:24 2014 +0100
Use an event box to avoid the source view from getting mouse events
gtksourceview/gtksourcestyleschemechooserwidget.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcestyleschemechooserwidget.c
b/gtksourceview/gtksourcestyleschemechooserwidget.c
index 00c0338..c4b0998 100644
--- a/gtksourceview/gtksourcestyleschemechooserwidget.c
+++ b/gtksourceview/gtksourcestyleschemechooserwidget.c
@@ -135,8 +135,9 @@ make_row (GtkSourceStyleScheme *scheme,
GtkSourceLanguage *language)
{
GtkWidget *row;
+ GtkWidget *event;
GtkSourceBuffer *buffer;
- GtkSourceView *view;
+ GtkWidget *view;
gchar *text;
row = gtk_list_box_row_new ();
@@ -144,6 +145,11 @@ make_row (GtkSourceStyleScheme *scheme,
g_object_set_data (G_OBJECT (row), "scheme", scheme);
+ event = gtk_event_box_new ();
+ gtk_event_box_set_above_child (GTK_EVENT_BOX (event), TRUE);
+ gtk_widget_show (event);
+ gtk_container_add (GTK_CONTAINER (row), event);
+
buffer = gtk_source_buffer_new_with_language (language);
gtk_source_buffer_set_highlight_matching_brackets (buffer, FALSE);
gtk_source_buffer_set_style_scheme (buffer, scheme);
@@ -163,7 +169,7 @@ make_row (GtkSourceStyleScheme *scheme,
"show-right-margin", TRUE,
"margin", 2,
NULL);
- gtk_container_add (GTK_CONTAINER (row), GTK_WIDGET (view));
+ gtk_container_add (GTK_CONTAINER (event), view);
return row;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]