From: Andrej Kacian Date: Mon, 11 Feb 2019 22:10:45 +0000 (+0100) Subject: Reset Litehtml scrolledwindow to top-left when displaying new content X-Git-Tag: 3.17.4~109 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=6664c751b2ff73d0c11be616cbf13ee418ad52b7 Reset Litehtml scrolledwindow to top-left when displaying new content --- diff --git a/src/plugins/litehtml_viewer/lh_widget.cpp b/src/plugins/litehtml_viewer/lh_widget.cpp index 61abf615d..df6ee9900 100644 --- a/src/plugins/litehtml_viewer/lh_widget.cpp +++ b/src/plugins/litehtml_viewer/lh_widget.cpp @@ -218,6 +218,7 @@ statusbar_pop: void lh_widget::open_html(const gchar *contents) { gint num = clear_images(lh_prefs_get()->image_cache_size * 1024 * 1000); + GtkAdjustment *adj; debug_print("LH: cleared %d images from image cache\n", num); @@ -226,6 +227,12 @@ void lh_widget::open_html(const gchar *contents) m_rendered_width = 0; if (m_html != NULL) { debug_print("lh_widget::open_html created document\n"); + adj = gtk_scrolled_window_get_hadjustment( + GTK_SCROLLED_WINDOW(m_scrolled_window)); + gtk_adjustment_set_value(adj, 0.0); + adj = gtk_scrolled_window_get_vadjustment( + GTK_SCROLLED_WINDOW(m_scrolled_window)); + gtk_adjustment_set_value(adj, 0.0); redraw(); } lh_widget_statusbar_pop();