[gtk/matthiasc/for-master] gtk-demo: Fix iconscroll colors



commit 57a213a4eab24bfde4429368a5332c351031f540
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 8 14:36:16 2020 -0400

    gtk-demo: Fix iconscroll colors
    
    We changed the way the color grid works.
    Adapt the iconscroll use of it.
    
    Fixes: #3030

 demos/gtk-demo/iconscroll.c      | 6 ++++++
 demos/gtk-demo/listview_colors.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/demos/gtk-demo/iconscroll.c b/demos/gtk-demo/iconscroll.c
index 22e7448c56..09ed6c1258 100644
--- a/demos/gtk-demo/iconscroll.c
+++ b/demos/gtk-demo/iconscroll.c
@@ -153,14 +153,20 @@ populate_list (void)
 }
 
 extern GtkWidget *create_color_grid (void);
+extern GListModel *gtk_color_list_new (guint size);
 
 static void
 populate_grid (void)
 {
   GtkWidget *list;
+  GtkNoSelection *selection;
 
   list = create_color_grid ();
 
+  selection = gtk_no_selection_new (gtk_color_list_new (2097152));
+  gtk_grid_view_set_model (GTK_GRID_VIEW (list), G_LIST_MODEL (selection));
+  g_object_unref (selection);
+
   hincrement = 0;
   vincrement = 5;
 
diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c
index c8cf07cdba..d9e8d0c4b8 100644
--- a/demos/gtk-demo/listview_colors.c
+++ b/demos/gtk-demo/listview_colors.c
@@ -523,7 +523,7 @@ gtk_color_list_init (GtkColorList *self)
   g_bytes_unref (data);
 }
 
-static GListModel *
+GListModel *
 gtk_color_list_new (guint size)
 {
   return g_object_new (GTK_TYPE_COLOR_LIST,


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