2010-03-23 [pawel] 3.7.5cvs37
[claws.git] / src / mimeview.c
index 39d334fd47fe90d61b5cbf7924fb9dc791b68395..b514356fc0bc17e775151e4843cca403bfa61560 100644 (file)
@@ -278,16 +278,22 @@ MimeView *mimeview_create(MainWindow *mainwin)
                                       GTK_POLICY_AUTOMATIC);
 
        ctree = gtk_sctree_new_with_titles(N_MIMEVIEW_COLS, 0, titles);
-       gtk_widget_show(ctree);
+
+       if (prefs_common.show_col_headers == FALSE)
+               gtk_cmclist_column_titles_hide(GTK_CMCLIST(ctree));
+
        gtk_cmclist_set_selection_mode(GTK_CMCLIST(ctree), GTK_SELECTION_BROWSE);
        gtk_cmctree_set_line_style(GTK_CMCTREE(ctree), GTK_CMCTREE_LINES_NONE);
        gtk_cmclist_set_column_justification(GTK_CMCLIST(ctree), COL_SIZE,
                                           GTK_JUSTIFY_RIGHT);
        gtk_cmclist_set_column_width(GTK_CMCLIST(ctree), COL_MIMETYPE, 240);
        gtk_cmclist_set_column_width(GTK_CMCLIST(ctree), COL_SIZE, 90);
+       gtk_cmclist_set_column_auto_resize(GTK_CMCLIST(ctree), COL_MIMETYPE, TRUE);
+       gtk_cmclist_set_column_auto_resize(GTK_CMCLIST(ctree), COL_NAME, TRUE); 
        for (i = 0; i < N_MIMEVIEW_COLS; i++)
                GTK_WIDGET_UNSET_FLAGS(GTK_CMCLIST(ctree)->column[i].button,
                                       GTK_CAN_FOCUS);
+       gtk_widget_show(ctree);
        gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
 
        g_signal_connect(G_OBJECT(ctree), "tree_select_row",
@@ -2332,9 +2338,15 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
        content_type = procmime_get_content_type_str(mimeinfo->type,
                                                     mimeinfo->subtype);
 
+#if GTK_CHECK_VERSION(2,12,0)
        tip = g_strconcat("<b>", _("Type:"), "  </b>", content_type,
                          "\n<b>", _("Size:"), " </b>",
                          to_human_readable((goffset)mimeinfo->length), NULL);
+#else
+       tip = g_strconcat(_("Type:"), " ", content_type,
+                         "\n", _("Size:"), " ",
+                         to_human_readable((goffset)mimeinfo->length), NULL);
+#endif 
        g_free(content_type);
        if (desc && *desc) {
                gchar *tmp = NULL;
@@ -2343,10 +2355,17 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
                } else {
                        tmp = g_strdup(desc);
                }
+#if GTK_CHECK_VERSION(2,12,0)
                tiptmp = g_strconcat(tip, "\n<b>",
                                prefs_common.attach_desc && mimeinfo->description ?
-                               _("Description") : _("Filename:"),
+                               _("Description:") : _("Filename:"),
                                " </b>", tmp, NULL);
+#else
+               tiptmp = g_strconcat(tip, "\n",
+                               prefs_common.attach_desc && mimeinfo->description ?
+                               _("Description:") : _("Filename:"),
+                               " ", tmp, NULL);
+#endif
                g_free(tip);
                tip = tiptmp;
                g_free(tmp);
@@ -2358,7 +2377,11 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
        }
        g_free(sigshort);
 
+#if GTK_CHECK_VERSION(2,12,0)
        gtk_widget_set_tooltip_markup(button, tip);
+#else
+       CLAWS_SET_TIP(button, tip);
+#endif
        g_free(tip);
        gtk_widget_show_all(button);
        gtk_drag_source_set(button, GDK_BUTTON1_MASK|GDK_BUTTON3_MASK,