Merge branch 'wip/otte/for-main' into 'main'

inspector: Allow searching for editable text

See merge request GNOME/gtk!4801
This commit is contained in:
Benjamin Otte 2022-06-07 18:20:43 +00:00
commit dec6a93510
3 changed files with 25 additions and 21 deletions

View File

@ -1363,34 +1363,20 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
self_width = gtk_widget_get_width (GTK_WIDGET (self));
self_height = gtk_widget_get_height (GTK_WIDGET (self));
if (y + height + GTK_LIST_BASE_CHILD_MAX_OVERDRAW <= 0 ||
y - GTK_LIST_BASE_CHILD_MAX_OVERDRAW >= self_height ||
x + width + GTK_LIST_BASE_CHILD_MAX_OVERDRAW <= 0 ||
x - GTK_LIST_BASE_CHILD_MAX_OVERDRAW >= self_width)
{
/* child is fully outside the viewport, hide it and don't allocate it */
gtk_widget_set_child_visible (child, FALSE);
return;
}
gtk_widget_set_child_visible (child, TRUE);
if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
{
if (_gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_LTR)
{
child_allocation.x = x;
child_allocation.y = y;
child_allocation.width = width;
child_allocation.height = height;
}
else
{
child_allocation.x = self_width - x - width;
child_allocation.y = y;
child_allocation.width = width;
child_allocation.height = height;
}
child_allocation.width = width;
child_allocation.height = height;
}
else
{
@ -1398,18 +1384,32 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
{
child_allocation.x = y;
child_allocation.y = x;
child_allocation.width = height;
child_allocation.height = width;
}
else
{
child_allocation.x = self_width - y - height;
child_allocation.y = x;
child_allocation.width = height;
child_allocation.height = width;
}
child_allocation.width = height;
child_allocation.height = width;
}
if (!gdk_rectangle_intersect (&child_allocation,
&(GdkRectangle) {
- GTK_LIST_BASE_CHILD_MAX_OVERDRAW,
- GTK_LIST_BASE_CHILD_MAX_OVERDRAW,
self_width + GTK_LIST_BASE_CHILD_MAX_OVERDRAW,
self_height + GTK_LIST_BASE_CHILD_MAX_OVERDRAW
},
NULL))
{
/* child is fully outside the viewport, hide it and don't allocate it */
gtk_widget_set_child_visible (child, FALSE);
return;
}
gtk_widget_set_child_visible (child, TRUE);
gtk_widget_size_allocate (child, &child_allocation, -1);
}

View File

@ -653,7 +653,7 @@ gtk_video_set_media_stream (GtkVideo *self,
}
/**
* gtk_video_get_file: (attributes org.gtk.Method.get_propert=file)
* gtk_video_get_file: (attributes org.gtk.Method.get_property=file)
* @self: a `GtkVideo`
*
* Gets the file played by @self or %NULL if not playing back

View File

@ -841,6 +841,8 @@ match_object (GObject *object,
return match_string (gtk_window_get_title (GTK_WINDOW (object)), text);
else if (GTK_IS_TREE_VIEW_COLUMN (object))
return match_string (gtk_tree_view_column_get_title (GTK_TREE_VIEW_COLUMN (object)), text);
else if (GTK_IS_EDITABLE (object))
return match_string (gtk_editable_get_text (GTK_EDITABLE (object)), text);
address = g_strdup_printf ("%p", object);
ret = match_string (address, text);
@ -1094,6 +1096,8 @@ bind_label_cb (GtkSignalListItemFactory *factory,
binding = g_object_bind_property (item, "title", label, "label", G_BINDING_SYNC_CREATE);
else if (GTK_IS_TREE_VIEW_COLUMN (item))
binding = g_object_bind_property (item, "title", label, "label", G_BINDING_SYNC_CREATE);
else if (GTK_IS_EDITABLE (item))
binding = g_object_bind_property (item, "text", label, "label", G_BINDING_SYNC_CREATE);
else
gtk_label_set_label (GTK_LABEL (label), NULL);