html scrolling - please test
- From: Carlos Morgado <chbm chbm nu>
- To: Balsa List <balsa-list gnome org>
- Subject: html scrolling - please test
- Date: Sat, 7 Dec 2002 16:18:06 +0000
Here's a patch to enable keyboard and mouse scrolling in html parts.
Could the list please test it, specially people with less common system ?
cheers
--
Carlos Morgado - chbm(at)chbm(dot)nu - http://chbm.nu/ -- gpgkey: 0x1FC57F0A
http://wwwkeys.pgp.net/ FP:0A27 35D3 C448 3641 0573 6876 2A37 4BB2 1FC5 7F0A
[ rm vs .sig - rm 1 .sig 0]
Index: src/balsa-message.c
===================================================================
RCS file: /cvs/gnome/balsa/src/balsa-message.c,v
retrieving revision 1.211
diff -u -r1.211 balsa-message.c
--- src/balsa-message.c 17 Nov 2002 09:51:01 -0000 1.211
+++ src/balsa-message.c 7 Dec 2002 16:16:53 -0000
@@ -1913,7 +1913,7 @@
#else
part_info_init_unknown(bm, info);
#endif
- } else {
+ } else { /* not html */
regex_t rex;
GtkWidget *item = NULL;
GdkFont *fnt = NULL;
@@ -1921,15 +1921,15 @@
fnt = find_body_font(info->body);
- if (bm->wrap_text) {
- if (balsa_app.recognize_rfc2646_format_flowed
- && libbalsa_flowed_rfc2646(info->body)) {
- ptr =
- libbalsa_wrap_rfc2646(ptr, balsa_app.browse_wrap_length,
- FALSE, TRUE);
- } else
- libbalsa_wrap_string(ptr, balsa_app.browse_wrap_length);
- }
+ if (bm->wrap_text) {
+ if (balsa_app.recognize_rfc2646_format_flowed
+ && libbalsa_flowed_rfc2646(info->body)) {
+ ptr =
+ libbalsa_wrap_rfc2646(ptr, balsa_app.browse_wrap_length,
+ FALSE, TRUE);
+ } else
+ libbalsa_wrap_string(ptr, balsa_app.browse_wrap_length);
+ }
if (!fnt)
fnt = gdk_fontset_load(balsa_app.message_font);
@@ -2026,11 +2026,7 @@
size_t len)
{
GtkHTMLStream *stream;
- GtkWidget *html, *scroll;
-
- scroll = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
- GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+ GtkWidget *html;
html = gtk_html_new();
@@ -2038,7 +2034,7 @@
gtk_html_write(GTK_HTML(html), stream, ptr, len);
gtk_html_end(GTK_HTML(html), stream, GTK_HTML_STREAM_OK);
gtk_html_set_editable(GTK_HTML(html), FALSE);
-
+
gtk_signal_connect(GTK_OBJECT(html), "size_request",
(GtkSignalFunc) balsa_gtk_html_size_request,
(gpointer) bm);
@@ -2048,14 +2044,19 @@
gtk_signal_connect(GTK_OBJECT(html), "on_url",
GTK_SIGNAL_FUNC(balsa_gtk_html_on_url),
bm);
-
- gtk_container_add(GTK_CONTAINER(scroll), html);
-
+ gtk_signal_connect(GTK_OBJECT(html), "key_press_event",
+ (GtkSignalFunc)balsa_message_key_press_event,
+ (gpointer) bm);
+ gtk_signal_connect(GTK_OBJECT(html), "focus_in_event",
+ (GtkSignalFunc)balsa_message_focus_in_part,
+ (gpointer) bm);
+ gtk_signal_connect(GTK_OBJECT(html), "focus_out_event",
+ (GtkSignalFunc)balsa_message_focus_out_part,
+ (gpointer) bm);
gtk_widget_show(html);
- gtk_widget_show(scroll);
info->focus_widget = html;
- info->widget = scroll;
+ info->widget = html;
info->can_display = TRUE;
}
#endif
@@ -2866,8 +2867,8 @@
g_return_if_fail(GTK_IS_HTML(widget));
g_return_if_fail(requisition != NULL);
- requisition->width = -(widget->style->klass->xthickness + 1) * 2;
- requisition->height = -(widget->style->klass->ythickness + 1) * 2;
+ requisition->width = (widget->style->klass->xthickness + 1) * 2;
+ requisition->height = (widget->style->klass->ythickness + 1) * 2;
requisition->width += GTK_LAYOUT(widget)->hadjustment->upper -1 /*EMP*/;
requisition->height += GTK_LAYOUT(widget)->vadjustment->upper -1 /*EMP*/;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]