[evolution/kill-bonobo] Fix a couple attachment issues



commit 8ea9f9377f071d4e8088e5c744e5470ccddb0fb1
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Apr 24 09:18:58 2009 -0400

    Fix a couple attachment issues
    
    Add a fallback icon name to attachments with GThemedIcons, just in case
    there's a problem loading the MIME type icon.  I seen this when I build
    GTK+ locally and it can't find gnome-icon-theme icons.  Also, fix a
    packing issue in EAttachmentPaned.  CompEditor's attachment bar is still
    having problems, however.
---
 widgets/misc/e-attachment-paned.c |    7 +++++--
 widgets/misc/e-attachment.c       |    8 ++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c
index a09fef0..3fed031 100644
--- a/widgets/misc/e-attachment-paned.c
+++ b/widgets/misc/e-attachment-paned.c
@@ -37,6 +37,9 @@
 
 #define NUM_VIEWS 2
 
+/* Initial height of the lower pane. */
+#define INITIAL_HEIGHT 150
+
 struct _EAttachmentPanedPrivate {
 	GtkTreeModel *model;
 	GtkWidget *expander;
@@ -511,10 +514,10 @@ attachment_paned_init (EAttachmentPaned *paned)
 	container = GTK_WIDGET (paned);
 
 	widget = gtk_notebook_new ();
-	gtk_widget_set_size_request (widget, -1, 40);
+	gtk_widget_set_size_request (widget, -1, INITIAL_HEIGHT);
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
 	gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
-	gtk_paned_pack2 (GTK_PANED (container), widget, TRUE, FALSE);
+	gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE);
 	paned->priv->notebook = g_object_ref (widget);
 	gtk_widget_hide (widget);
 
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 92ebd36..ee5446e 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -347,6 +347,7 @@ attachment_set_file_info (EAttachment *attachment,
                           GFileInfo *file_info)
 {
 	GtkTreeRowReference *reference;
+	GIcon *icon;
 
 	reference = e_attachment_get_reference (attachment);
 
@@ -358,6 +359,13 @@ attachment_set_file_info (EAttachment *attachment,
 
 	attachment->priv->file_info = file_info;
 
+	/* If the GFileInfo contains a GThemedIcon, append a
+	 * fallback icon name to ensure we display something. */
+	icon = g_file_info_get_icon (file_info);
+	if (G_IS_THEMED_ICON (icon))
+		g_themed_icon_append_name (
+			G_THEMED_ICON (icon), DEFAULT_ICON_NAME);
+
 	g_object_notify (G_OBJECT (attachment), "file-info");
 
 	/* Tell the EAttachmentStore its total size changed. */



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