gtk-demo: Add an "Unsorted" option (and default to it)

Tests the previous commit and ensures that selecting 16M colors actually
works quickly (it does).
This commit is contained in:
Benjamin Otte 2020-06-21 06:54:21 +02:00
parent a928ea6c57
commit 727a78a74f

View File

@ -792,6 +792,14 @@ do_listview_colors (GtkWidget *do_widget)
sorters = g_list_store_new (GTK_TYPE_SORTER);
/* An empty multisorter doesn't do any sorting and the sortmodel is
* smart enough to know that.
*/
sorter = gtk_multi_sorter_new ();
set_title (sorter, "Unsorted");
g_list_store_append (sorters, sorter);
g_object_unref (sorter);
sorter = gtk_string_sorter_new (gtk_property_expression_new (GTK_TYPE_COLOR, NULL, "name"));
set_title (sorter, "Name");
g_list_store_append (sorters, sorter);