Commit 3211e82b authored by Vadim Rutkovsky's avatar Vadim Rutkovsky

inspector: show accessible name and description

parent 6c8c37ab
......@@ -63,6 +63,10 @@ struct _GtkInspectorMiscInfoPrivate {
GtkWidget *framecount;
GtkWidget *accessible_role_row;
GtkWidget *accessible_role;
GtkWidget *accessible_name_row;
GtkWidget *accessible_name;
GtkWidget *accessible_description_row;
GtkWidget *accessible_description;
GtkWidget *mapped_row;
GtkWidget *mapped;
GtkWidget *realized_row;
......@@ -316,6 +320,8 @@ update_info (gpointer data)
accessible = ATK_OBJECT (gtk_widget_get_accessible (GTK_WIDGET (sl->priv->object)));
role = atk_object_get_role (accessible);
gtk_label_set_text (GTK_LABEL (sl->priv->accessible_role), atk_role_get_name (role));
gtk_label_set_text (GTK_LABEL (sl->priv->accessible_name), atk_object_get_name (accessible));
gtk_label_set_text (GTK_LABEL (sl->priv->accessible_description), atk_object_get_description (accessible));
gtk_widget_set_visible (sl->priv->mapped, gtk_widget_get_mapped (GTK_WIDGET (sl->priv->object)));
gtk_widget_set_visible (sl->priv->realized, gtk_widget_get_realized (GTK_WIDGET (sl->priv->object)));
gtk_widget_set_visible (sl->priv->is_toplevel, gtk_widget_is_toplevel (GTK_WIDGET (sl->priv->object)));
......@@ -407,6 +413,8 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
gtk_widget_show (sl->priv->mnemonic_label_row);
gtk_widget_show (sl->priv->tick_callback_row);
gtk_widget_show (sl->priv->accessible_role_row);
gtk_widget_show (sl->priv->accessible_name_row);
gtk_widget_show (sl->priv->accessible_description_row);
gtk_widget_show (sl->priv->mapped_row);
gtk_widget_show (sl->priv->realized_row);
gtk_widget_show (sl->priv->is_toplevel_row);
......@@ -426,6 +434,8 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
gtk_widget_hide (sl->priv->clip_area_row);
gtk_widget_hide (sl->priv->tick_callback_row);
gtk_widget_hide (sl->priv->accessible_role_row);
gtk_widget_hide (sl->priv->accessible_name_row);
gtk_widget_hide (sl->priv->accessible_description_row);
gtk_widget_hide (sl->priv->mapped_row);
gtk_widget_hide (sl->priv->realized_row);
gtk_widget_hide (sl->priv->is_toplevel_row);
......@@ -581,6 +591,10 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, framerate);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_role_row);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_role);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_name_row);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_name);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_description_row);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_description);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, mapped_row);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, mapped);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, realized_row);
......
......@@ -491,6 +491,74 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="accessible_name_row">
<property name="visible">true</property>
<property name="activatable">false</property>
<child>
<object class="GtkBox">
<property name="visible">true</property>
<property name="orientation">horizontal</property>
<property name="margin">10</property>
<property name="spacing">40</property>
<child>
<object class="GtkLabel">
<property name="visible">true</property>
<property name="label" translatable="yes">Accessible name</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">true</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="accessible_name">
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow" id="accessible_description_row">
<property name="visible">true</property>
<property name="activatable">false</property>
<child>
<object class="GtkBox">
<property name="visible">true</property>
<property name="orientation">horizontal</property>
<property name="margin">10</property>
<property name="spacing">40</property>
<child>
<object class="GtkLabel">
<property name="visible">true</property>
<property name="label" translatable="yes">Accessible description</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">true</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="accessible_description">
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow" id="mapped_row">
<property name="visible">true</property>
......
......@@ -13,6 +13,8 @@ N_("Tick callback");
N_("Frame count");
N_("Frame rate");
N_("Accessible role");
N_("Accessible name");
N_("Accessible description");
N_("Mapped");
N_("Realized");
N_("Is Toplevel");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment