static void html_adjustment_changed (GtkAdjustment *adj, gpointer data);
static void disconnect_vadjustment (ModestMsgView *obj);
static void disconnect_hadjustment (ModestMsgView *obj);
+static gboolean idle_readjust_scroll (ModestMsgView *obj);
/* GtkContainer methods */
static void forall (GtkContainer *container, gboolean include_internals,
gboolean vadj_changed;
gint new_height;
+ g_signal_stop_emission_by_name (G_OBJECT (adj), "changed");
+
priv->html_scroll->requisition.height = html_vadj->upper;
+ if (html_vadj->upper == priv->html_scroll->allocation.height)
+ return;
priv->html_scroll->allocation.height = html_vadj->upper;
set_vadjustment_values (msg_view, &vadj_changed);
gtk_box_pack_start (GTK_BOX(priv->headers_box), priv->mail_header_view, FALSE, FALSE, 0);
if (priv->attachments_view) {
- priv->attachments_box = (GtkWidget *) modest_mail_header_view_add_custom_header (MODEST_MAIL_HEADER_VIEW (priv->mail_header_view),
- _("Attachments:"), priv->attachments_view,
- FALSE, FALSE);
+ gchar *att_label = g_strconcat (_("mcen_me_viewer_attachments"), ":", NULL);
+
+ priv->attachments_box = (GtkWidget *)
+ modest_mail_header_view_add_custom_header (MODEST_MAIL_HEADER_VIEW (priv->mail_header_view),
+ att_label,
+ priv->attachments_view,
+ FALSE, FALSE);
gtk_widget_hide_all (priv->attachments_box);
+ g_free (att_label);
/* gtk_widget_set_no_show_all (priv->attachments_box, TRUE); */
}
TnyMimePart *body;
ModestMsgViewPrivate *priv;
TnyHeader *header;
+ GtkAdjustment *html_vadj;
g_return_if_fail (self);
if (priv->vadj != NULL)
priv->vadj->value = 0.0;
+ html_vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (priv->html_scroll));
+
+ g_signal_emit_by_name (G_OBJECT (html_vadj), "changed");
+
+ /* This is a hack to force reallocation of scroll after drawing all the stuff. This
+ * makes the html view get the proper and expected size and prevent being able to scroll
+ * the buffer when it shouldn't be scrollable */
+ g_object_ref (self);
+ g_timeout_add (250, (GSourceFunc) idle_readjust_scroll, self);
}
gtk_layout_set_vadjustment (GTK_LAYOUT (priv->gtkhtml), tmp_vadj);
result = gtk_html_engine_search (GTK_HTML (priv->gtkhtml),
search,
- FALSE, TRUE, TRUE);
+ FALSE, /* case sensitive */
+ TRUE, /* forward */
+ FALSE); /* regexp */
-// wait for the updated gtkhtml (w27) to enable this
-#if 0
if (result) {
gint x, y, w, h;
gdouble offset_top, offset_bottom;
else if (offset_bottom > adj->value + adj->page_increment)
gtk_adjustment_set_value (adj, offset_bottom - adj->page_increment);
}
-#endif
y_offset = tmp_vadj->value;
gtk_layout_set_vadjustment (GTK_LAYOUT (priv->gtkhtml), vadj);
priv = MODEST_MSG_VIEW_GET_PRIVATE (self);
result = gtk_html_engine_search_next (GTK_HTML (priv->gtkhtml));
-// fixme wait for new gtkhtml
-#if 0
if (result) {
gint x, y, w, h;
gdouble offset_top, offset_bottom;
else if (offset_bottom > adj->value + adj->page_increment)
gtk_adjustment_set_value (adj, offset_bottom - adj->page_increment);
}
-#endif
return result;
}
attachment);
}
+
+gboolean
+idle_readjust_scroll (ModestMsgView *view)
+{
+ if (GTK_WIDGET_DRAWABLE (view)) {
+ ModestMsgViewPrivate *priv = MODEST_MSG_VIEW_GET_PRIVATE (view);
+ GtkAdjustment *html_vadj;
+ html_vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (priv->html_scroll));
+ html_vadj->page_size = html_vadj->upper;
+ gtk_adjustment_changed (html_vadj);
+ gtk_widget_queue_resize (GTK_WIDGET (view));
+ gtk_widget_queue_draw (GTK_WIDGET (view));
+
+ /* Just another hack for making readjust really work. This forces an update
+ * of the scroll, and then, make the scroll really update properly the
+ * the size and not corrupt scrollable area */
+ gtk_adjustment_set_value (priv->vadj, 1.0);
+ gtk_adjustment_set_value (priv->vadj, 0.0);
+ }
+ g_object_unref (G_OBJECT (view));
+ return FALSE;
+}