From da9b4d778b800912545f382e57eddd0c469265ec Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 27 Jul 2020 12:39:43 -0400 Subject: [PATCH 1/2] NEWS: Tweak the wording --- NEWS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 8de44774b1..ddc546ee64 100644 --- a/NEWS +++ b/NEWS @@ -7,9 +7,8 @@ Overview of Changes in GTK 3.99.0 the backend implementations will use GtkATContext. Currently, there is just a nascent test backend. -* The GTK headers have been updated to use char *, - int, float and double instead of the corresponding - GLib types. +* Update the GTK headers to use char *, int, float and + double instead of the corresponding GLib types. * Add GtkEditableLabel, a label that can be edited From 99ec400c2ac76b1873d9842867f2a615aae8b66c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 27 Jul 2020 13:21:59 -0400 Subject: [PATCH 2/2] gtk-demo: Simplify colors demo Make best use of our new constructors. --- demos/gtk-demo/listview_colors.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c index c2c2960645..f809b73c1b 100644 --- a/demos/gtk-demo/listview_colors.c +++ b/demos/gtk-demo/listview_colors.c @@ -1080,19 +1080,17 @@ do_listview_colors (GtkWidget *do_widget) g_list_store_append (sorters, multi_sorter); g_object_unref (multi_sorter); - dropdown = gtk_drop_down_new (G_LIST_MODEL (sorters), NULL); - box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_append (GTK_BOX (box), gtk_label_new ("Sort by:")); - gtk_box_append (GTK_BOX (box), dropdown); - gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box); - expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, (GCallback)get_title, NULL, NULL); - gtk_drop_down_set_expression (GTK_DROP_DOWN (dropdown), expression); - gtk_expression_unref (expression); + + dropdown = gtk_drop_down_new (G_LIST_MODEL (sorters), expression); + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); + gtk_box_append (GTK_BOX (box), gtk_label_new ("Sort by:")); + gtk_box_append (GTK_BOX (box), dropdown); + gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box); g_object_bind_property (dropdown, "selected-item", sort_model, "sorter", G_BINDING_SYNC_CREATE); @@ -1108,19 +1106,16 @@ do_listview_colors (GtkWidget *do_widget) set_title (factory, "Everything"); g_list_store_append (factories, factory); - dropdown = gtk_drop_down_new (G_LIST_MODEL (factories), NULL); - box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_append (GTK_BOX (box), gtk_label_new ("Show:")); - gtk_box_append (GTK_BOX (box), dropdown); - gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box); - expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, (GCallback)get_title, NULL, NULL); - gtk_drop_down_set_expression (GTK_DROP_DOWN (dropdown), expression); - gtk_expression_unref (expression); + dropdown = gtk_drop_down_new (G_LIST_MODEL (factories), expression); + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); + gtk_box_append (GTK_BOX (box), gtk_label_new ("Show:")); + gtk_box_append (GTK_BOX (box), dropdown); + gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box); g_object_bind_property (dropdown, "selected-item", gridview, "factory", G_BINDING_SYNC_CREATE); }