[Commits] [SCM] claws branch, master, updated. 3.17.0-117-gc38d063

claws at claws-mail.org claws at claws-mail.org
Tue Oct 16 08:38:24 CEST 2018


The branch, master has been updated
       via  c38d063474e079cad014292a128c63d7d018b748 (commit)
      from  dcab487a808b5a341627adaf99d07d994709987c (commit)

Summary of changes:
 src/plugins/pdf_viewer/poppler_viewer.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit c38d063474e079cad014292a128c63d7d018b748
Author: Paul <paul at claws-mail.org>
Date:   Tue Oct 16 07:38:19 2018 +0100

    fix invalid cast runtime warning

diff --git a/src/plugins/pdf_viewer/poppler_viewer.c b/src/plugins/pdf_viewer/poppler_viewer.c
index 6b8b270..5df4661 100644
--- a/src/plugins/pdf_viewer/poppler_viewer.c
+++ b/src/plugins/pdf_viewer/poppler_viewer.c
@@ -83,7 +83,7 @@ static void pdf_viewer_button_rotate_left_cb(GtkButton *button, PdfViewer *viewe
 static void pdf_viewer_spin_change_page_cb(GtkSpinButton *button, PdfViewer *viewer);
 static void pdf_viewer_spin_zoom_scroll_cb(GtkSpinButton *button, PdfViewer *viewer);
 /* Show/Hide the index pane */
-static void pdf_viewer_show_document_index_cb(GtkButton *button, PdfViewer *viewer);
+static void pdf_viewer_show_document_index_cb(GtkToggleButton *button, PdfViewer *viewer);
 static void pdf_viewer_button_print_cb(GtkButton *button, PdfViewer *viewer);
 static void pdf_viewer_button_document_info_cb(GtkButton *button, PdfViewer *viewer);
 
@@ -1188,7 +1188,7 @@ static void pdf_viewer_button_rotate_left_cb(GtkButton *button, PdfViewer *viewe
 }
 
 /* Show/Hide the index pane */
-static void pdf_viewer_show_document_index_cb(GtkButton *button, PdfViewer *viewer)
+static void pdf_viewer_show_document_index_cb(GtkToggleButton *button, PdfViewer *viewer)
 {
 	if (!viewer->pdf_index) {
 		viewer->pdf_index = poppler_index_iter_new(viewer->pdf_doc);
@@ -1633,6 +1633,13 @@ static void pdf_viewer_scroll_one_line(MimeViewer *_viewer, gboolean up)
 	gtk_table_attach(GTK_TABLE(viewer->widgets_table), GTK_WIDGET(widget), \
 				col, col+1, 0, 1, 0, 0, BUTTON_H_PADDING, 0); \
 	col++;
+#define ADD_TOGGLE_BUTTON_TO_TABLE(widget, stock_image) \
+	widget = gtk_toggle_button_new(); \
+	img = stock_pixmap_widget(stock_image); \
+	gtk_button_set_image(GTK_BUTTON(widget), img); \
+	gtk_table_attach(GTK_TABLE(viewer->widgets_table), GTK_WIDGET(widget), \
+				col, col+1, 0, 1, 0, 0, BUTTON_H_PADDING, 0); \
+	col++;
 
 #define ADD_SEP_TO_TABLE \
 	sep = gtk_label_new(""); \
@@ -1809,7 +1816,7 @@ static MimeViewer *pdf_viewer_create(void)
 	ADD_SEP_TO_TABLE
 	ADD_BUTTON_TO_TABLE(viewer->print, STOCK_PIXMAP_PRINTER)
 	ADD_BUTTON_TO_TABLE(viewer->doc_info, STOCK_PIXMAP_DOC_INFO)
-	ADD_BUTTON_TO_TABLE(viewer->doc_index, STOCK_PIXMAP_DOC_INDEX)
+	ADD_TOGGLE_BUTTON_TO_TABLE(viewer->doc_index, STOCK_PIXMAP_DOC_INDEX)
 
 	gtk_scrolled_window_set_policy(
 			GTK_SCROLLED_WINDOW(viewer->scrollwin), 
@@ -2082,6 +2089,7 @@ static MimeViewer *pdf_viewer_create(void)
 }
 
 #undef ADD_BUTTON_TO_TABLE
+#undef ADD_TOGGLE_BUTTON_TO_TABLE
 #undef ADD_SEP_TO_TABLE
 #undef BUTTON_H_PADDING
 #undef SEP_H_PADDING

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list