[gtk/wip/otte/listview-colors] gtk-demo: Add an "Unsorted" option (and default to it)



commit 27272c2a7fddd91c7145d8fabe81197e06a8c9be
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jun 21 06:54:21 2020 +0200

    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).

 demos/gtk-demo/listview_colors.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c
index 7441b3249a..9e6acab411 100644
--- a/demos/gtk-demo/listview_colors.c
+++ b/demos/gtk-demo/listview_colors.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]