diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-07-10 16:24:12 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-07-10 16:25:55 -0400 |
commit | 743406998c3c704a9756bfe0e8b882d3df464b3e (patch) | |
tree | 7c8695baaf864eb0bf282fd61c79b9ee0819a79a /gtk/inspector | |
parent | f56c0bc0340117351d162c7d8e63499d547d9493 (diff) | |
download | gtk+-743406998c3c704a9756bfe0e8b882d3df464b3e.tar.gz |
inspector: Hide measure graphs by default
It is much more valuable to have a responsive inspector,
than to have these graphs.
Diffstat (limited to 'gtk/inspector')
-rw-r--r-- | gtk/inspector/misc-info.c | 12 | ||||
-rw-r--r-- | gtk/inspector/misc-info.ui | 10 |
2 files changed, 20 insertions, 2 deletions
diff --git a/gtk/inspector/misc-info.c b/gtk/inspector/misc-info.c index 0908bd9bb0..1bace8ae36 100644 --- a/gtk/inspector/misc-info.c +++ b/gtk/inspector/misc-info.c @@ -165,7 +165,15 @@ update_allocation (GtkWidget *w, gtk_label_set_label (GTK_LABEL (sl->request_mode), value->value_nick); g_type_class_unref (class); - gtk_inspector_measure_graph_measure (GTK_INSPECTOR_MEASURE_GRAPH (sl->measure_graph), w); + if (gtk_widget_get_visible (sl->measure_row)) + gtk_inspector_measure_graph_measure (GTK_INSPECTOR_MEASURE_GRAPH (sl->measure_graph), w); +} + +static void +measure_graph_measure (GtkWidget *button, + GtkInspectorMiscInfo *sl) +{ + gtk_inspector_measure_graph_measure (GTK_INSPECTOR_MEASURE_GRAPH (sl->measure_graph), GTK_WIDGET (sl->object)); } static void @@ -500,7 +508,6 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl, gtk_widget_show (sl->state_row); gtk_widget_show (sl->direction_row); gtk_widget_show (sl->request_mode_row); - gtk_widget_show (sl->measure_row); gtk_widget_show (sl->allocated_size_row); gtk_widget_show (sl->baseline_row); gtk_widget_show (sl->mnemonic_label_row); @@ -662,6 +669,7 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass) gtk_widget_class_bind_template_callback (widget_class, update_measure_picture); gtk_widget_class_bind_template_callback (widget_class, measure_picture_drag_prepare); + gtk_widget_class_bind_template_callback (widget_class, measure_graph_measure); gtk_widget_class_bind_template_callback (widget_class, show_surface); gtk_widget_class_bind_template_callback (widget_class, show_renderer); gtk_widget_class_bind_template_callback (widget_class, show_frame_clock); diff --git a/gtk/inspector/misc-info.ui b/gtk/inspector/misc-info.ui index 1ec347f6fd..efe9bccce8 100644 --- a/gtk/inspector/misc-info.ui +++ b/gtk/inspector/misc-info.ui @@ -274,6 +274,15 @@ </object> </child> <child> + <object class="GtkToggleButton" id="measure_show"> + <property name="label" translatable="yes">Show</property> + <property name="halign">end</property> + <property name="valign">baseline</property> + <signal name="clicked" handler="update_measure_picture" swapped="yes" after="1" object="measure_picture"/> + <signal name="clicked" handler="measure_graph_measure" after="1"/> + </object> + </child> + <child> <object class="GtkToggleButton" id="measure_expand_toggle"> <property name="label" translatable="yes">Expand</property> <property name="halign">end</property> @@ -288,6 +297,7 @@ <child> <object class="GtkListBoxRow" id="measure_row"> <property name="activatable">0</property> + <property name="visible" bind-source="measure_show" bind-property="active" bind-flags="sync-create"/> <child> <object class="GtkBox"> <property name="margin-start">10</property> |