Merge branch 'for-master' into 'master'

For master

See merge request GNOME/gtk!911
This commit is contained in:
Benjamin Otte 2019-06-04 04:24:28 +00:00
commit 5c0737e44c
3 changed files with 39 additions and 20 deletions

View File

@ -523,22 +523,6 @@ on_range_to_changed (GtkSpinButton *to)
gtk_spin_button_set_value (from, v2);
}
static void
update_header (GtkListBoxRow *row,
GtkListBoxRow *before,
gpointer data)
{
if (before != NULL &&
gtk_list_box_row_get_header (row) == NULL)
{
GtkWidget *separator;
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show (separator);
gtk_list_box_row_set_header (row, separator);
}
}
static void
info_bar_response (GtkWidget *infobar, gint response_id)
{
@ -1731,7 +1715,6 @@ activate (GApplication *app)
g_signal_connect (adj, "value-changed", G_CALLBACK (spin_value_changed), widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "listbox");
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_header, NULL, NULL);
g_signal_connect (widget, "row-activated", G_CALLBACK (row_activated), NULL);
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "listboxrow1switch");

View File

@ -1620,6 +1620,7 @@ microphone-sensitivity-medium-symbolic</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<child type="placeholder">
<object class="GtkLabel">
<property name="label">No rows found</property>

View File

@ -925,13 +925,27 @@ _gtk_builder_add (GtkBuilder *builder,
g_assert (object != NULL);
parent = ((ObjectInfo*)child_info->parent)->object;
g_assert (GTK_IS_BUILDABLE (parent));
GTK_NOTE (BUILDER,
g_message ("adding %s to %s", object_get_name (object), object_get_name (parent)));
gtk_buildable_add_child (GTK_BUILDABLE (parent), builder, object,
child_info->type);
if (G_IS_LIST_STORE (parent))
{
if (child_info->type != NULL)
{
GTK_BUILDER_WARN_INVALID_CHILD_TYPE (parent, child_info->type);
}
else
{
g_list_store_append (G_LIST_STORE (parent), object);
}
}
else
{
g_assert (GTK_IS_BUILDABLE (parent));
gtk_buildable_add_child (GTK_BUILDABLE (parent), builder, object,
child_info->type);
}
child_info->added = TRUE;
}
@ -2201,6 +2215,27 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
else
ret = FALSE;
break;
case G_TYPE_POINTER:
if (G_VALUE_HOLDS (value, G_TYPE_GTYPE))
{
GType resolved_type;
resolved_type = gtk_builder_get_type_from_name (builder, string);
if (resolved_type == G_TYPE_INVALID)
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Unsupported GType '%s' for value of type 'GType'", string);
return FALSE;
}
g_value_set_gtype (value, resolved_type);
ret = TRUE;
}
else
ret = FALSE;
break;
default:
ret = FALSE;
break;