[Commits] [SCM] claws branch, master, updated. 3.17.4-64-gf8c6182be

colin at claws-mail.org colin at claws-mail.org
Sun Nov 10 19:55:39 CET 2019


The branch, master has been updated
       via  f8c6182be4dea5e6fb48e67c49c5292d9f77e32f (commit)
      from  844944f102a6a295b818eca8bf6e8e7a2f2e0f92 (commit)

Summary of changes:
 src/plugins/litehtml_viewer/lh_viewer.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)


- Log -----------------------------------------------------------------
commit f8c6182be4dea5e6fb48e67c49c5292d9f77e32f
Author: Colin Leroy <colin at colino.net>
Date:   Sun Nov 10 20:55:11 2019 +0100

    LiteHtml viewer: implement keyboard scroll

diff --git a/src/plugins/litehtml_viewer/lh_viewer.c b/src/plugins/litehtml_viewer/lh_viewer.c
index cca94d5fa..7fee13e47 100644
--- a/src/plugins/litehtml_viewer/lh_viewer.c
+++ b/src/plugins/litehtml_viewer/lh_viewer.c
@@ -140,6 +140,31 @@ static void lh_print_viewer (MimeViewer *_viewer)
     lh_widget_print(viewer->widget);    
 }
 
+
+static gboolean lh_scroll_page(MimeViewer *_viewer, gboolean up)
+{
+	LHViewer *viewer = (LHViewer *)_viewer;
+	GtkAdjustment *vadj = gtk_scrolled_window_get_vadjustment(
+					GTK_SCROLLED_WINDOW(lh_widget_get_widget(viewer->widget)));
+
+	if (viewer->widget == NULL)
+		return FALSE;
+
+	return gtkutils_scroll_page(lh_widget_get_widget(viewer->widget), vadj, up);
+}
+
+static void lh_scroll_one_line(MimeViewer *_viewer, gboolean up)
+{
+	LHViewer *viewer = (LHViewer *)_viewer;
+	GtkAdjustment *vadj = gtk_scrolled_window_get_vadjustment(
+					GTK_SCROLLED_WINDOW(lh_widget_get_widget(viewer->widget)));
+
+	if (viewer->widget == NULL)
+		return;
+
+	gtkutils_scroll_one_line(lh_widget_get_widget(viewer->widget), vadj, up);
+}
+
 /***************************************************************/
 MimeViewer *lh_viewer_create()
 {
@@ -155,6 +180,9 @@ MimeViewer *lh_viewer_create()
 	viewer->mimeviewer.clear_viewer = lh_clear_viewer;
 	viewer->mimeviewer.destroy_viewer = lh_destroy_viewer;
 
+	viewer->mimeviewer.scroll_page = lh_scroll_page;
+	viewer->mimeviewer.scroll_one_line = lh_scroll_one_line;
+
 	viewer->vbox = gtk_vbox_new(FALSE, 0);
 
 	GtkWidget *w = lh_widget_get_widget(viewer->widget);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list