[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-591-g3833e1f

ticho at claws-mail.org ticho at claws-mail.org
Sat Jan 12 23:55:41 CET 2019


The branch, gtk3 has been updated
       via  3833e1f728822c2d9dffe02f8f9cc1ec76d2d930 (commit)
       via  8adbf38cfec39c78c2560903614baa2873f63b85 (commit)
      from  4aabbe7475d7666ff48ae196876bd42d16845e83 (commit)

Summary of changes:
 src/compose.c                           |    2 +-
 src/gtk/description_window.c            |    2 +-
 src/gtk/prefswindow.c                   |    3 +--
 src/image_viewer.c                      |   18 ++++++++++--------
 src/plugins/pdf_viewer/poppler_viewer.c |    8 ++++----
 src/plugins/vcalendar/day-view.c        |    4 ----
 src/plugins/vcalendar/month-view.c      |    4 ----
 src/plugins/vcalendar/vcalendar.c       |    5 ++---
 src/prefs_template.c                    |    3 +--
 src/printing.c                          |    3 +--
 src/wizard.c                            |   12 ++++--------
 11 files changed, 25 insertions(+), 39 deletions(-)


- Log -----------------------------------------------------------------
commit 3833e1f728822c2d9dffe02f8f9cc1ec76d2d930
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Jan 12 23:52:40 2019 +0100

    Fix image viewer resizing
    
    For some reason, GTK3's GtkImage does not update its
    size when new contents get set to it. We have to force
    it by calling gtk_widget_size_allocate() on its parent
    container.

diff --git a/src/image_viewer.c b/src/image_viewer.c
index 10d7d39..f2a2a53 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -87,7 +87,7 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
 
 		if (imageviewer->resize_img) {
 			gtk_widget_get_allocation(
-				gtk_widget_get_parent(imageviewer->notebook), &allocation);
+				gtk_widget_get_parent(imageviewer->image), &allocation);
 			pixbuf = claws_load_pixbuf_fitting(pixbuf,
 				allocation.width,
 				allocation.height);
@@ -108,17 +108,19 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
 		return;
 	}
 
+	g_signal_handlers_block_by_func(G_OBJECT(imageviewer->scrolledwin),
+			 G_CALLBACK(scrolledwin_resize_cb), imageviewer);
+
 	if (animation)
 		gtk_image_set_from_animation(GTK_IMAGE(imageviewer->image), animation);
 	else
 		gtk_image_set_from_pixbuf(GTK_IMAGE(imageviewer->image), pixbuf);
 
-	g_signal_handlers_block_by_func(G_OBJECT(imageviewer->scrolledwin), 
-			 G_CALLBACK(scrolledwin_resize_cb), imageviewer);
-
+	gtk_widget_get_allocation(imageviewer->scrolledwin, &allocation);
+	gtk_widget_size_allocate(imageviewer->scrolledwin, &allocation);
 
 	gtk_widget_show(imageviewer->image);
-	GTK_EVENTS_FLUSH();
+
 	g_signal_handlers_unblock_by_func(G_OBJECT(imageviewer->scrolledwin), 
 			 G_CALLBACK(scrolledwin_resize_cb), imageviewer);
 

commit 8adbf38cfec39c78c2560903614baa2873f63b85
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Jan 12 23:51:19 2019 +0100

    Remove use of deprecated gtk_scrolled_window_add_with_viewport()

diff --git a/src/compose.c b/src/compose.c
index 31d7b62..e5f9062 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7392,7 +7392,7 @@ static GtkWidget *compose_create_header(Compose *compose)
 	header_table = gtk_table_new(2, 2, FALSE);
 	gtk_widget_show(header_table);
 	gtk_container_set_border_width(GTK_CONTAINER(header_table), 0);
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(header_scrolledwin), header_table);
+	gtk_container_add(GTK_CONTAINER(header_scrolledwin), header_table);
 	gtk_container_set_focus_vadjustment(GTK_CONTAINER(header_table),
 			gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(header_scrolledwin)));
 	gtk_viewport_set_shadow_type(GTK_VIEWPORT(gtk_bin_get_child(GTK_BIN(header_scrolledwin))), GTK_SHADOW_NONE);
diff --git a/src/gtk/description_window.c b/src/gtk/description_window.c
index fd3bb00..dacdb14 100644
--- a/src/gtk/description_window.c
+++ b/src/gtk/description_window.c
@@ -97,7 +97,7 @@ static void description_create(DescriptionWindow * dwindow)
 				       GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	
 	table = gtk_table_new(sz, dwindow->columns, FALSE);
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwin), table);
+	gtk_container_add(GTK_CONTAINER(scrolledwin), table);
 	gtk_container_set_border_width(GTK_CONTAINER(table), 4);
 
 	gtk_table_set_col_spacings(GTK_TABLE(table), 8);
diff --git a/src/gtk/prefswindow.c b/src/gtk/prefswindow.c
index 608cf60..0fc4c2a 100644
--- a/src/gtk/prefswindow.c
+++ b/src/gtk/prefswindow.c
@@ -262,8 +262,7 @@ static void prefswindow_build_page(PrefsWindow *prefswindow, PrefsPage *page)
 			GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 		
 		page->create_widget(page, GTK_WINDOW(prefswindow->window), prefswindow->data);
-		gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwin),
-					page->widget);
+		gtk_container_add(GTK_CONTAINER(scrolledwin), page->widget);
 
 		gtk_container_add(GTK_CONTAINER(prefswindow->notebook), scrolledwin);
 		tmp = gtk_bin_get_child(GTK_BIN(scrolledwin));
diff --git a/src/image_viewer.c b/src/image_viewer.c
index ef2655d..10d7d39 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -382,9 +382,9 @@ static MimeViewer *image_viewer_create(void)
 
 	imageviewer->scrolledwin  = scrolledwin;
 	imageviewer->image = gtk_image_new();
-	gtk_scrolled_window_add_with_viewport
-		(GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
-		 imageviewer->image);
+	gtk_container_add(
+			GTK_CONTAINER(imageviewer->scrolledwin),
+			imageviewer->image);
 	imageviewer->notebook	  = notebook;
 	imageviewer->filename	  = filename;
 	imageviewer->filesize	  = filesize;
diff --git a/src/plugins/pdf_viewer/poppler_viewer.c b/src/plugins/pdf_viewer/poppler_viewer.c
index c84a356..2c2ab50 100644
--- a/src/plugins/pdf_viewer/poppler_viewer.c
+++ b/src/plugins/pdf_viewer/poppler_viewer.c
@@ -1828,8 +1828,8 @@ static MimeViewer *pdf_viewer_create(void)
 			GTK_SCROLLED_WINDOW(viewer->scrollwin),
 			GTK_SHADOW_IN);
 
-	gtk_scrolled_window_add_with_viewport(
-			GTK_SCROLLED_WINDOW(viewer->scrollwin),
+	gtk_container_add(
+			GTK_CONTAINER(viewer->scrollwin),
 			viewer->pdf_view_ebox);
 
 	viewer->vbox = gtk_vbox_new(FALSE, 4);
@@ -1866,8 +1866,8 @@ static MimeViewer *pdf_viewer_create(void)
 			GTK_SCROLLED_WINDOW(viewer->scrollwin_index),
 			GTK_SHADOW_IN);
 
-	gtk_scrolled_window_add_with_viewport(
-			GTK_SCROLLED_WINDOW(viewer->scrollwin_index),
+	gtk_container_add(
+			GTK_CONTAINER(viewer->scrollwin_index),
 			viewer->index_list);
 
 	/* end treeview */
diff --git a/src/plugins/vcalendar/day-view.c b/src/plugins/vcalendar/day-view.c
index e263c6e..fd7daee 100644
--- a/src/plugins/vcalendar/day-view.c
+++ b/src/plugins/vcalendar/day-view.c
@@ -753,11 +753,7 @@ static void build_day_view_table(day_win *dw)
     gtk_box_pack_start(GTK_BOX(dw->Vbox), dw->scroll_win_h
             , TRUE, TRUE, 0);
     dw->day_view_vbox = gtk_vbox_new(FALSE, 0);
-    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(dw->scroll_win_h)
-            , dw->day_view_vbox);
-    /*
     gtk_container_add(GTK_CONTAINER(dw->scroll_win_h), dw->day_view_vbox);
-    */
     /* row 1= day header buttons 
      * row 2= full day events after the buttons */
     dw->dtable_h = gtk_table_new(2 , days+2, FALSE);
diff --git a/src/plugins/vcalendar/month-view.c b/src/plugins/vcalendar/month-view.c
index 67dfaaa..a72fc55 100644
--- a/src/plugins/vcalendar/month-view.c
+++ b/src/plugins/vcalendar/month-view.c
@@ -852,11 +852,7 @@ static void build_month_view_table(month_win *mw)
     gtk_box_pack_start(GTK_BOX(mw->Vbox), mw->scroll_win_h
             , TRUE, TRUE, 0);
     mw->month_view_vbox = gtk_vbox_new(FALSE, 0);
-    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(mw->scroll_win_h)
-            , mw->month_view_vbox);
-    /*
     gtk_container_add(GTK_CONTAINER(mw->scroll_win_h), mw->month_view_vbox);
-    */
     /* row 1= day header buttons 
      * row 2= full day events after the buttons */
     mw->dtable_h = gtk_table_new(2 , days+2, FALSE);
diff --git a/src/plugins/vcalendar/vcalendar.c b/src/plugins/vcalendar/vcalendar.c
index e8c3d66..ed184b8 100644
--- a/src/plugins/vcalendar/vcalendar.c
+++ b/src/plugins/vcalendar/vcalendar.c
@@ -1255,9 +1255,8 @@ MimeViewer *vcal_viewer_create(void)
 	TABLE_ADD_LINE(_("Action:"), vbox);
 	
 	vcalviewer->scrolledwin = gtk_scrolled_window_new(NULL, NULL);
-	gtk_scrolled_window_add_with_viewport(
-		GTK_SCROLLED_WINDOW(vcalviewer->scrolledwin), 
-		vcalviewer->table);
+	gtk_container_add(GTK_CONTAINER(vcalviewer->scrolledwin),
+			vcalviewer->table);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vcalviewer->scrolledwin),
 				       GTK_POLICY_NEVER,
 				       GTK_POLICY_AUTOMATIC);
diff --git a/src/prefs_template.c b/src/prefs_template.c
index 70de6b4..c211bad 100644
--- a/src/prefs_template.c
+++ b/src/prefs_template.c
@@ -208,8 +208,7 @@ static void prefs_template_window_create(void)
 	/* vpaned to separate template settings from templates list */
 	vpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
 	gtk_widget_show(vpaned);
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
- 					      vpaned);
+	gtk_container_add(GTK_CONTAINER(scrolled_window), vpaned);
 	gtk_viewport_set_shadow_type (GTK_VIEWPORT(
 			gtk_bin_get_child(GTK_BIN(scrolled_window))), GTK_SHADOW_NONE);
 
diff --git a/src/printing.c b/src/printing.c
index 3ea1ab4..7bef9f0 100644
--- a/src/printing.c
+++ b/src/printing.c
@@ -516,8 +516,7 @@ static gboolean cb_preview(GtkPrintOperation        *operation,
 	gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
 	da = gtk_drawing_area_new();
 	gtk_widget_set_double_buffered(da, FALSE);
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw),
-					      da);
+	gtk_container_add(GTK_CONTAINER(sw), da);
 	gtk_widget_realize(da);
 	preview_data->scrolled_window = sw;
 	preview_data->area = da;
diff --git a/src/wizard.c b/src/wizard.c
index 3ef4e61..b09416b 100644
--- a/src/wizard.c
+++ b/src/wizard.c
@@ -1844,8 +1844,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
- 					      user_page(wizard));
+	gtk_container_add(GTK_CONTAINER(scrolled_window), user_page(wizard));
 	PACK_WARNING(_("Bold fields must be completed"));
 	
 	wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1859,8 +1858,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
- 					      recv_page(wizard));
+	gtk_container_add(GTK_CONTAINER(scrolled_window), recv_page(wizard));
 	PACK_WARNING(_("Bold fields must be completed"));
 	
 	wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1874,8 +1872,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
- 					      smtp_page(wizard));
+	gtk_container_add(GTK_CONTAINER(scrolled_window), smtp_page(wizard));
 	PACK_WARNING(_("Bold fields must be completed"));
 	
 	wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1890,8 +1887,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 		gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-		gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
- 					      mailbox_page(wizard));
+		gtk_container_add(GTK_CONTAINER(scrolled_window), mailbox_page(wizard));
 		PACK_WARNING(_("Bold fields must be completed"));
 	
 		wizard->pages = g_slist_append(wizard->pages, widget);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list