[balsa] Handle key-press events on WebKitwebview widget



commit 707faf0bb9723c67953361632969b4307587c596
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Mar 20 14:15:17 2010 -0400

    Handle key-press events on WebKitwebview widget
    
    	* libbalsa/html.c (libbalsa_html_get_view_widget): new method to
    	get the actual view widget.
    	* libbalsa/html.h: ditto.
    	* src/balsa-mime-widget-text.c (bm_widget_new_html): connect to
    	key-press-event on the actual view widget.

 ChangeLog                    |    8 ++++++++
 libbalsa/html.c              |   15 +++++++++++++++
 libbalsa/html.h              |    1 +
 src/balsa-mime-widget-text.c |    3 ++-
 4 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0492923..e993013 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-20  Peter Bloomfield
+
+	* libbalsa/html.c (libbalsa_html_get_view_widget): new method to
+	get the actual view widget.
+	* libbalsa/html.h: ditto.
+	* src/balsa-mime-widget-text.c (bm_widget_new_html): connect to
+	key-press-event on the actual view widget.
+
 2010-03-11  Peter Bloomfield
 
 	* libbalsa/files.c (libbalsa_icon_finder): allocate string only
diff --git a/libbalsa/html.c b/libbalsa/html.c
index a332674..a027e92 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -663,6 +663,12 @@ libbalsa_html_popup_menu_widget(GtkWidget * widget)
         GTK_WIDGET(web_view) : NULL;
 }
 
+GtkWidget *
+libbalsa_html_get_view_widget(GtkWidget * widget)
+{
+    return libbalsa_html_popup_menu_widget(widget);
+}
+
 /*
  * Does the widget support printing?
  */
@@ -1195,6 +1201,15 @@ libbalsa_html_popup_menu_widget(GtkWidget *widget)
     return NULL;
 }
 
+/*
+ * Each widget is its own view widget.
+ */
+GtkWidget *
+libbalsa_html_get_view_widget(GtkWidget * widget)
+{
+    return widget;
+}
+
 # endif                         /* defined(HAVE_WEBKIT) */
 
 /* Filter text/enriched or text/richtext to text/html, if we have GMime
diff --git a/libbalsa/html.h b/libbalsa/html.h
index 6ce686f..2889d5e 100644
--- a/libbalsa/html.h
+++ b/libbalsa/html.h
@@ -66,6 +66,7 @@ void libbalsa_html_get_selection_bounds(GtkWidget * widget,
                                         GdkRectangle * selection_bounds);
 
 GtkWidget *libbalsa_html_popup_menu_widget(GtkWidget * widget);
+GtkWidget *libbalsa_html_get_view_widget(GtkWidget * widget);
 
 gboolean libbalsa_html_can_print(GtkWidget * widget);
 void libbalsa_html_print(GtkWidget * widget);
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index 56e1bba..ee54ce3 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -1111,7 +1111,8 @@ bm_widget_new_html(BalsaMessage * bm, LibBalsaMessageBody * mime_body)
                           (LibBalsaHtmlCallback) handle_url);
     g_object_set_data(G_OBJECT(mw->widget), "mime-body", mime_body);
 
-    g_signal_connect(G_OBJECT(mw->widget), "key_press_event",
+    g_signal_connect(libbalsa_html_get_view_widget(mw->widget),
+                     "key_press_event",
                      G_CALLBACK(balsa_mime_widget_key_press_event), bm);
     if ((widget = libbalsa_html_popup_menu_widget(mw->widget))) {
         g_object_set_data(G_OBJECT(widget), "balsa-message", bm);



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