Merge branch 'matthiasc/for-main' into 'main'

inspector: Cosmetics

See merge request GNOME/gtk!6078
This commit is contained in:
Matthias Clasen 2023-06-10 03:17:14 +00:00
commit 8155b08de8
8 changed files with 102 additions and 9 deletions

View File

@ -204,6 +204,7 @@ gsk_gl_texture_library_dispose (GObject *object)
g_clear_pointer (&self->atlases, g_ptr_array_unref);
g_clear_object (&self->driver);
g_clear_pointer (&self->hash_table, g_hash_table_unref);
G_OBJECT_CLASS (gsk_gl_texture_library_parent_class)->dispose (object);
}

View File

@ -5638,9 +5638,12 @@ static void
gsk_mask_node_finalize (GskRenderNode *node)
{
GskMaskNode *self = (GskMaskNode *) node;
GskRenderNodeClass *parent_class = g_type_class_peek (g_type_parent (GSK_TYPE_MASK_NODE));
gsk_render_node_unref (self->source);
gsk_render_node_unref (self->mask);
parent_class->finalize (node);
}
static void

View File

@ -723,9 +723,9 @@ gtk_file_filter_add_pixbuf_formats (GtkFileFilter *filter)
mime_types = gdk_pixbuf_format_get_mime_types (l->data);
for (i = 0; mime_types[i] != NULL; i++)
{
g_ptr_array_add (array, g_content_type_from_mime_type (mime_types[i]));
}
g_ptr_array_add (array, g_content_type_from_mime_type (mime_types[i]));
g_strfreev (mime_types);
}
g_slist_free (formats);

View File

@ -201,6 +201,8 @@ struct _GtkInspectorA11y
GtkWidget *box;
GtkWidget *role;
GtkWidget *name;
GtkWidget *description;
GtkWidget *bounds;
GtkWidget *path_label;
GtkWidget *path;
@ -229,6 +231,30 @@ update_role (GtkInspectorA11y *sl)
g_type_class_unref (eclass);
}
static void
update_name (GtkInspectorA11y *sl)
{
GtkATContext *context;
char *name;
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
name = gtk_at_context_get_name (context);
gtk_label_set_label (GTK_LABEL (sl->name), name);
}
static void
update_description (GtkInspectorA11y *sl)
{
GtkATContext *context;
char *description;
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
description = gtk_at_context_get_description (context);
gtk_label_set_label (GTK_LABEL (sl->description), description);
}
static void
update_path (GtkInspectorA11y *sl)
{
@ -426,6 +452,8 @@ static void
refresh_all (GtkInspectorA11y *sl)
{
update_role (sl);
update_name (sl);
update_description (sl);
update_path (sl);
update_attributes (sl);
}
@ -518,6 +546,8 @@ gtk_inspector_a11y_class_init (GtkInspectorA11yClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/a11y.ui");
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, role);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, name);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, description);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, bounds);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, path_label);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, path);

View File

@ -39,8 +39,8 @@
</object>
</child>
<child>
<object class="GtkLabel" id="bounds_label">
<property name="label" translatable="yes">Bounds</property>
<object class="GtkLabel" id="name_label">
<property name="label" translatable="yes">Name</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
@ -51,7 +51,7 @@
</object>
</child>
<child>
<object class="GtkLabel" id="bounds">
<object class="GtkLabel" id="name">
<property name="selectable">1</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
@ -59,6 +59,58 @@
<property name="row">1</property>
<property name="column">1</property>
</layout>
<accessibility>
<relation name="labelled-by">name_label</relation>
</accessibility>
</object>
</child>
<child>
<object class="GtkLabel" id="description_label">
<property name="label" translatable="yes">Description</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
<layout>
<property name="row">2</property>
<property name="column">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="description">
<property name="selectable">1</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
<layout>
<property name="row">2</property>
<property name="column">1</property>
</layout>
<accessibility>
<relation name="labelled-by">description_label</relation>
</accessibility>
</object>
</child>
<child>
<object class="GtkLabel" id="bounds_label">
<property name="label" translatable="yes">Bounds</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
<layout>
<property name="row">3</property>
<property name="column">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="bounds">
<property name="selectable">1</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
<layout>
<property name="row">3</property>
<property name="column">1</property>
</layout>
<accessibility>
<relation name="labelled-by">bounds_label</relation>
</accessibility>
@ -71,7 +123,7 @@
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
<layout>
<property name="row">2</property>
<property name="row">4</property>
<property name="column">0</property>
</layout>
</object>
@ -82,7 +134,7 @@
<property name="halign">end</property>
<property name="valign">baseline</property>
<layout>
<property name="row">2</property>
<property name="row">4</property>
<property name="column">1</property>
</layout>
<accessibility>

View File

@ -382,7 +382,7 @@
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="fps_label">
<property name="label" translatable="yes">Show fps overlay</property>
<property name="label" translatable="yes">Show Framerate</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>

View File

@ -392,6 +392,9 @@ test_texture_downloader (void)
g_free (data);
g_bytes_unref (bytes);
gdk_texture_downloader_free (downloader);
g_object_unref (texture2);
g_object_unref (texture);
}
int

View File

@ -481,6 +481,10 @@ main (int argc, char **argv)
gsk_render_node_unref (node);
gsk_renderer_unrealize (renderer);
g_object_unref (renderer);
gdk_surface_destroy (window);
gdk_display_close (gdk_display_get_default ());
return success ? 0 : 1;