diff options
Diffstat (limited to 'gtk/gtkfilesel.c')
-rw-r--r-- | gtk/gtkfilesel.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 1a656256c3..3227d6f062 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -518,6 +518,7 @@ gtk_file_selection_init (GtkFileSelection *filesel) gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row", (GtkSignalFunc) gtk_file_selection_dir_button, (gpointer) filesel); + gtk_clist_set_column_auto_resize (GTK_CLIST (filesel->dir_list), 0, TRUE); gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); scrolled_win = gtk_scrolled_window_new (NULL, NULL); @@ -537,6 +538,7 @@ gtk_file_selection_init (GtkFileSelection *filesel) gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", (GtkSignalFunc) gtk_file_selection_file_button, (gpointer) filesel); + gtk_clist_set_column_auto_resize (GTK_CLIST (filesel->file_list), 0, TRUE); gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); scrolled_win = gtk_scrolled_window_new (NULL, NULL); @@ -672,8 +674,11 @@ gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel) g_return_if_fail (filesel != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); - if (filesel->fileop_ren_file) - gtk_widget_destroy (filesel->fileop_ren_file); + if (filesel->fileop_ren_file) + { + gtk_widget_destroy (filesel->fileop_ren_file); + filesel->fileop_ren_file = NULL; + } if (filesel->fileop_del_file) { @@ -1428,7 +1433,6 @@ win32_gtk_add_drives_to_dir_list(GtkWidget *the_dir_list) gchar buffer[128]; char volumeNameBuf[128]; char formatBuffer[128]; - gint row; text[1] = NULL; @@ -1457,7 +1461,7 @@ win32_gtk_add_drives_to_dir_list(GtkWidget *the_dir_list) #endif /* Add to the list */ text[0] = formatBuffer; - row = gtk_clist_append (GTK_CLIST (the_dir_list), text); + gtk_clist_append (GTK_CLIST (the_dir_list), text); } textPtr += (strlen(textPtr) + 1); } @@ -1472,15 +1476,12 @@ gtk_file_selection_populate (GtkFileSelection *fs, CompletionState *cmpl_state; PossibleCompletion* poss; gchar* filename; - gint row; gchar* rem_path = rel_path; gchar* sel_text; gchar* text[2]; gint did_recurse = FALSE; gint possible_count = 0; gint selection_index = -1; - gint file_list_width; - gint dir_list_width; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); @@ -1505,16 +1506,10 @@ gtk_file_selection_populate (GtkFileSelection *fs, /* Set the dir_list to include ./ and ../ */ text[1] = NULL; text[0] = "." G_DIR_SEPARATOR_S; - row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + gtk_clist_append (GTK_CLIST (fs->dir_list), text); text[0] = ".." G_DIR_SEPARATOR_S; - row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); - - /*reset the max widths of the lists*/ - dir_list_width = gdk_string_width(fs->dir_list->style->font,".." G_DIR_SEPARATOR_S); - gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,dir_list_width); - file_list_width = 1; - gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,file_list_width); + gtk_clist_append (GTK_CLIST (fs->dir_list), text); while (poss) { @@ -1530,29 +1525,11 @@ gtk_file_selection_populate (GtkFileSelection *fs, { if (strcmp (filename, "." G_DIR_SEPARATOR_S) != 0 && strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0) - { - int width = gdk_string_width(fs->dir_list->style->font, - filename); - row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); - if(width > dir_list_width) - { - dir_list_width = width; - gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0, - width); - } - } + gtk_clist_append (GTK_CLIST (fs->dir_list), text); } else { - int width = gdk_string_width(fs->file_list->style->font, - filename); - row = gtk_clist_append (GTK_CLIST (fs->file_list), text); - if(width > file_list_width) - { - file_list_width = width; - gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, - width); - } + gtk_clist_append (GTK_CLIST (fs->file_list), text); } } |