inspector: Show baseline value
The misc info page already shows the allocation and clip areas, the baseline fits right in.
This commit is contained in:
@ -55,6 +55,8 @@ struct _GtkInspectorMiscInfoPrivate {
|
||||
GtkWidget *request_mode;
|
||||
GtkWidget *allocated_size_row;
|
||||
GtkWidget *allocated_size;
|
||||
GtkWidget *baseline_row;
|
||||
GtkWidget *baseline;
|
||||
GtkWidget *clip_area_row;
|
||||
GtkWidget *clip_area;
|
||||
GtkWidget *tick_callback_row;
|
||||
@ -147,6 +149,10 @@ allocation_changed (GtkWidget *w, GdkRectangle *allocation, GtkInspectorMiscInfo
|
||||
gtk_label_set_label (GTK_LABEL (sl->priv->allocated_size), size_label);
|
||||
g_free (size_label);
|
||||
|
||||
size_label = g_strdup_printf ("%d", gtk_widget_get_allocated_baseline (w));
|
||||
gtk_label_set_label (GTK_LABEL (sl->priv->baseline), size_label);
|
||||
g_free (size_label);
|
||||
|
||||
gtk_widget_get_clip (w, &clip);
|
||||
|
||||
size_label = g_strdup_printf ("%d × %d +%d +%d",
|
||||
@ -414,6 +420,7 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
|
||||
gtk_widget_show (sl->priv->state_row);
|
||||
gtk_widget_show (sl->priv->request_mode_row);
|
||||
gtk_widget_show (sl->priv->allocated_size_row);
|
||||
gtk_widget_show (sl->priv->baseline_row);
|
||||
gtk_widget_show (sl->priv->clip_area_row);
|
||||
gtk_widget_show (sl->priv->mnemonic_label_row);
|
||||
gtk_widget_show (sl->priv->tick_callback_row);
|
||||
@ -437,6 +444,7 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
|
||||
gtk_widget_hide (sl->priv->request_mode_row);
|
||||
gtk_widget_hide (sl->priv->mnemonic_label_row);
|
||||
gtk_widget_hide (sl->priv->allocated_size_row);
|
||||
gtk_widget_hide (sl->priv->baseline_row);
|
||||
gtk_widget_hide (sl->priv->clip_area_row);
|
||||
gtk_widget_hide (sl->priv->tick_callback_row);
|
||||
gtk_widget_hide (sl->priv->accessible_role_row);
|
||||
@ -589,6 +597,8 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, request_mode);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, allocated_size_row);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, allocated_size);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, baseline_row);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, baseline);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, clip_area_row);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, clip_area);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, tick_callback_row);
|
||||
|
||||
@ -353,6 +353,40 @@
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow" id="baseline_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">Baseline</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="baseline">
|
||||
<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="clip_area_row">
|
||||
<property name="visible">true</property>
|
||||
|
||||
Reference in New Issue
Block a user