[gtk/wip/otte/bitset: 11/23] gtk-demo: Port listview-colors demo to multiselection again



commit a0e75b9c265adc75c31acdfd302efdfa69c84392
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jun 21 18:00:11 2020 +0200

    gtk-demo: Port listview-colors demo to multiselection again

 demos/gtk-demo/listview_colors.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
---
diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c
index 37034abf78..45fc900f53 100644
--- a/demos/gtk-demo/listview_colors.c
+++ b/demos/gtk-demo/listview_colors.c
@@ -25,7 +25,6 @@ struct _GtkColor
   char *name;
   GdkRGBA color;
   int h, s, v;
-  gboolean selected;
 };
 
 enum {
@@ -38,7 +37,6 @@ enum {
   PROP_HUE,
   PROP_SATURATION,
   PROP_VALUE,
-  PROP_SELECTED,
 
   N_COLOR_PROPS
 };
@@ -201,10 +199,6 @@ gtk_color_get_property (GObject    *object,
       g_value_set_int (value, self->v);
       break;
 
-    case PROP_SELECTED:
-      g_value_set_boolean (value, self->selected);
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -234,10 +228,6 @@ gtk_color_set_property (GObject      *object,
       self->v = round (100 * v);
       break;
 
-    case PROP_SELECTED:
-      self->selected = g_value_get_boolean (value);
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -279,8 +269,6 @@ gtk_color_class_init (GtkColorClass *klass)
     g_param_spec_int ("saturation", NULL, NULL, 0, 100, 0, G_PARAM_READABLE);
   color_properties[PROP_VALUE] =
     g_param_spec_int ("value", NULL, NULL, 0, 100, 0, G_PARAM_READABLE);
-  color_properties[PROP_SELECTED] =
-    g_param_spec_boolean ("selected", NULL, NULL, FALSE, G_PARAM_READWRITE);
 
   g_object_class_install_properties (gobject_class, N_COLOR_PROPS, color_properties);
 }
@@ -668,7 +656,7 @@ create_color_grid (void)
 
   model = G_LIST_MODEL (gtk_sort_list_model_new (gtk_color_list_new (0), NULL));
 
-  selection = G_LIST_MODEL (gtk_property_selection_new (model, "selected"));
+  selection = G_LIST_MODEL (gtk_multi_selection_new (model));
   gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), selection);
   g_object_unref (selection);
   g_object_unref (model);


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