[balsa/gtk3] Use previous calculation to resize images



commit 3c452e63536f54e61e5dde6cc564615af1947a20
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Dec 29 08:29:26 2010 -0500

    Use previous calculation to resize images

 ChangeLog                     |    5 +++++
 src/balsa-mime-widget-image.c |    8 +++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0ec856e..82607a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-29  Peter Bloomfield
+
+	* src/balsa-mime-widget-image.c (img_check_size): revert; use
+	previous calculation, with a different magic number (16).
+
 2010-12-28  Peter Bloomfield
 
 	* src/balsa-mime-widget-image.c (img_check_size): use parent
diff --git a/src/balsa-mime-widget-image.c b/src/balsa-mime-widget-image.c
index 3b1e826..ce01d1b 100644
--- a/src/balsa-mime-widget-image.c
+++ b/src/balsa-mime-widget-image.c
@@ -148,9 +148,15 @@ img_check_size(GtkImage ** widget_p)
     else
 	curr_w = 0;
 
+    gtk_widget_get_allocation(viewport, &allocation);
+    dst_w = allocation.width;
+    gtk_widget_get_allocation(gtk_bin_get_child(GTK_BIN(viewport)),
+                              &allocation);
+    dst_w -= allocation.width;
     gtk_widget_get_allocation(gtk_widget_get_parent(GTK_WIDGET(widget)),
                               &allocation);
-    dst_w = allocation.width;
+    dst_w += allocation.width;
+    dst_w -= 16;                /* Magic number? */
 
     if (dst_w < 32)
 	dst_w = 32;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]