[balsa] Use offscreen-window's allocation width



commit 174ee42fe53d80afd4ad922c6339eb1cad480cc5
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Apr 7 13:24:50 2010 -0400

    Use offscreen-window's allocation width
    
    	* src/balsa-index.c (bndx_string_width): use allocation width
    	instead of pixbuf width.

 ChangeLog         |    5 +++++
 src/balsa-index.c |    9 +++------
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 03f858d..39f57e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-07  Peter Bloomfield
+
+	* src/balsa-index.c (bndx_string_width): use allocation width
+	instead of pixbuf width.
+
 2010-04-06  Peter Bloomfield
 
 	* libbalsa/mailbox.c (msg_iterator): object-ref the stream if
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 50ddaa7..efb8ef1 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -285,8 +285,7 @@ bndx_string_width(const gchar * text)
 {
     GtkWidget *label;
     GtkWidget *window;
-    GdkPixbuf *pixbuf;
-    gint width;
+    GtkAllocation allocation;
 
     label = gtk_label_new(NULL);
     gtk_label_set_markup((GtkLabel *) label, text);
@@ -295,12 +294,10 @@ bndx_string_width(const gchar * text)
     gtk_container_add(GTK_CONTAINER(window), label);
     gtk_widget_show_all(window);
 
-    pixbuf = gtk_offscreen_window_get_pixbuf((GtkOffscreenWindow *) window);
-    width = gdk_pixbuf_get_width(pixbuf);
-
+    gtk_widget_get_allocation(window, &allocation);
     gtk_widget_destroy(window);
 
-    return width;
+    return allocation.width;
 }
 #else
 #define bndx_string_width(text) 50



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