commit 6664c751b2ff73d0c11be616cbf13ee418ad52b7
parent b3d5286074eb94ddfc520e06111e7e24f6ebc337
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Mon, 11 Feb 2019 23:10:45 +0100
Reset Litehtml scrolledwindow to top-left when displaying new content
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git 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();