aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-04-24 21:18:58 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-04-24 21:18:58 +0800
commit8ea9f9377f071d4e8088e5c744e5470ccddb0fb1 (patch)
treee932d7b46451146ad6b3f0187819c6261631f958 /widgets
parent3de59d003f6ed27bc383604bdcd45e2c7279298c (diff)
downloadgsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.tar
gsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.tar.gz
gsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.tar.bz2
gsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.tar.lz
gsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.tar.xz
gsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.tar.zst
gsoc2013-evolution-8ea9f9377f071d4e8088e5c744e5470ccddb0fb1.zip
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.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-attachment-paned.c7
-rw-r--r--widgets/misc/e-attachment.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c
index a09fef0a66..3fed031473 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 92ebd36be4..ee5446e699 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. */