From: Jose Dapena Paz Date: Thu, 2 Apr 2009 18:35:58 +0000 (+0000) Subject: Use new gtk_html api to set a maximum image size for images retrieved in X-Git-Tag: git_migration_finished~151 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=fb946ca2e6c896e2923d1f06c5f0b9a6d72b95b1 Use new gtk_html api to set a maximum image size for images retrieved in mail messages (fixes NB#107923). pmo-trunk-r8566 --- diff --git a/configure.ac b/configure.ac index c8a0e12..7dbe3e4 100644 --- a/configure.ac +++ b/configure.ac @@ -134,6 +134,8 @@ AC_SUBST(MODEST_GTKHTML_LIBS) CFLAGS="$MODEST_GTKHTML_CFLAGS" LIBS="$MODEST_GTKHTML_LIBS" AC_CHECK_DECLS([gtk_widget_tap_and_hold_setup],[],[], [#include ]) +AC_CHECK_FUNCS(gtk_html_set_max_image_size) +AC_SUBST(HAVE_GTK_HTML_SET_MAX_IMAGE_SIZE) AC_CHECK_FUNCS(gtk_html_get_selection_area) AC_SUBST(HAVE_GTK_HTML_GET_SELECTION_AREA) AC_CHECK_FUNCS(gtk_tree_view_column_get_cell_data_hint) diff --git a/src/widgets/modest-gtkhtml-mime-part-view.c b/src/widgets/modest-gtkhtml-mime-part-view.c index a53b7f2..22b9ec5 100644 --- a/src/widgets/modest-gtkhtml-mime-part-view.c +++ b/src/widgets/modest-gtkhtml-mime-part-view.c @@ -279,6 +279,14 @@ modest_gtkhtml_mime_part_view_init (ModestGtkhtmlMimePartView *self) gtk_html_set_images_blocking (GTK_HTML(self), TRUE); gtk_container_set_border_width (GTK_CONTAINER (self), MODEST_MARGIN_DEFAULT); +#ifdef MODEST_TOOLKIT_HILDON2 +#ifdef HAVE_GTK_HTML_SET_MAX_IMAGE_SIZE + /* We set a maximum width of a bit less than the width of the screen, and a + maximum height of 2 times the full size of the window. Should be enough */ + gtk_html_set_max_image_size (GTK_HTML (self), 720, 880); +#endif +#endif + gdk_color_parse ("#fff", &base); gdk_color_parse ("#000", &text); gtk_widget_modify_base (GTK_WIDGET (self), GTK_STATE_NORMAL, &base);