Mercurial > geeqie
comparison src/view_file_list.c @ 1700:bda2d599cc70
call gtk_tree_view_columns_autosize only when reall needed
gtk_tree_view_columns_autosize is rather expensive, call it only
afrer directory change or after user-requested refresh
author | nadvornik |
---|---|
date | Fri, 24 Jul 2009 12:45:42 +0000 |
parents | 81ccb9cf7ef5 |
children | 2725ab224b07 |
comparison
equal
deleted
inserted
replaced
1699:81ccb9cf7ef5 | 1700:bda2d599cc70 |
---|---|
474 { | 474 { |
475 ViewFile *vf = data; | 475 ViewFile *vf = data; |
476 | 476 |
477 vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE); | 477 vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE); |
478 vf_refresh(vf); | 478 vf_refresh(vf); |
479 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview)); | |
479 } | 480 } |
480 | 481 |
481 void vflist_popup_destroy_cb(GtkWidget *widget, gpointer data) | 482 void vflist_popup_destroy_cb(GtkWidget *widget, gpointer data) |
482 { | 483 { |
483 ViewFile *vf = data; | 484 ViewFile *vf = data; |
1712 gtk_tree_view_column_set_visible(column, !multiline); | 1713 gtk_tree_view_column_set_visible(column, !multiline); |
1713 | 1714 |
1714 column = gtk_tree_view_get_column(GTK_TREE_VIEW(listview), FILE_VIEW_COLUMN_DATE); | 1715 column = gtk_tree_view_get_column(GTK_TREE_VIEW(listview), FILE_VIEW_COLUMN_DATE); |
1715 if (!column) return; | 1716 if (!column) return; |
1716 gtk_tree_view_column_set_visible(column, !multiline); | 1717 gtk_tree_view_column_set_visible(column, !multiline); |
1717 | |
1718 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(listview)); | |
1719 } | 1718 } |
1720 | 1719 |
1721 static gboolean vflist_is_multiline(ViewFile *vf) | 1720 static gboolean vflist_is_multiline(ViewFile *vf) |
1722 { | 1721 { |
1723 return (VFLIST(vf)->thumbs_enabled && options->thumbnails.max_height >= 48); | 1722 return (VFLIST(vf)->thumbs_enabled && options->thumbnails.max_height >= 48); |
1948 *----------------------------------------------------------------------------- | 1947 *----------------------------------------------------------------------------- |
1949 */ | 1948 */ |
1950 | 1949 |
1951 gboolean vflist_set_fd(ViewFile *vf, FileData *dir_fd) | 1950 gboolean vflist_set_fd(ViewFile *vf, FileData *dir_fd) |
1952 { | 1951 { |
1952 gboolean ret; | |
1953 if (!dir_fd) return FALSE; | 1953 if (!dir_fd) return FALSE; |
1954 if (vf->dir_fd == dir_fd) return TRUE; | 1954 if (vf->dir_fd == dir_fd) return TRUE; |
1955 | 1955 |
1956 file_data_unref(vf->dir_fd); | 1956 file_data_unref(vf->dir_fd); |
1957 vf->dir_fd = file_data_ref(dir_fd); | 1957 vf->dir_fd = file_data_ref(dir_fd); |
1960 vflist_store_clear(vf); | 1960 vflist_store_clear(vf); |
1961 | 1961 |
1962 filelist_free(vf->list); | 1962 filelist_free(vf->list); |
1963 vf->list = NULL; | 1963 vf->list = NULL; |
1964 | 1964 |
1965 return vf_refresh(vf); | 1965 ret = vf_refresh(vf); |
1966 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview)); | |
1967 return ret; | |
1966 } | 1968 } |
1967 | 1969 |
1968 void vflist_destroy_cb(GtkWidget *widget, gpointer data) | 1970 void vflist_destroy_cb(GtkWidget *widget, gpointer data) |
1969 { | 1971 { |
1970 ViewFile *vf = data; | 1972 ViewFile *vf = data; |