Added sorting functionality to the column buttons. Enabled columns to
2000-07-06 Gene Z. Ragan <gzr@eazel.com> * mime-type-capplet/nautilus-mime-type-capplet.c: (column_clicked), (create_mime_list_and_scroller): Added sorting functionality to the column buttons. Enabled columns to respond to a click. Clicking a column header toggles between ascending and descending sort for that column.
This commit is contained in:
parent
981826b3e4
commit
663e79f17d
1 changed files with 22 additions and 0 deletions
|
@ -995,6 +995,22 @@ insert_mime_vals_into_clist (GList *type_list, GtkCList *clist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
column_clicked (GtkCList *clist, gint column, gpointer user_data)
|
||||||
|
{
|
||||||
|
gtk_clist_set_sort_column (clist, column);
|
||||||
|
|
||||||
|
/* Toggle sort type */
|
||||||
|
if (clist->sort_type == GTK_SORT_ASCENDING) {
|
||||||
|
gtk_clist_set_sort_type (clist, GTK_SORT_DESCENDING);
|
||||||
|
} else {
|
||||||
|
gtk_clist_set_sort_type (clist, GTK_SORT_ASCENDING);
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_clist_sort (clist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
create_mime_list_and_scroller (void)
|
create_mime_list_and_scroller (void)
|
||||||
{
|
{
|
||||||
|
@ -1023,6 +1039,12 @@ create_mime_list_and_scroller (void)
|
||||||
gtk_clist_select_row (GTK_CLIST (mime_list), 0, 0);
|
gtk_clist_select_row (GTK_CLIST (mime_list), 0, 0);
|
||||||
gtk_container_add (GTK_CONTAINER (window), mime_list);
|
gtk_container_add (GTK_CONTAINER (window), mime_list);
|
||||||
|
|
||||||
|
/* Enable all titles */
|
||||||
|
gtk_clist_column_titles_active (GTK_CLIST (mime_list));
|
||||||
|
gtk_signal_connect (GTK_OBJECT (mime_list), "click_column",
|
||||||
|
column_clicked, NULL);
|
||||||
|
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue