From 743406998c3c704a9756bfe0e8b882d3df464b3e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 10 Jul 2022 16:24:12 -0400 Subject: inspector: Hide measure graphs by default It is much more valuable to have a responsive inspector, than to have these graphs. --- gtk/inspector/misc-info.c | 12 ++++++++++-- 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 @@ -273,6 +273,15 @@ 1 + + + Show + end + baseline + + + + Expand @@ -288,6 +297,7 @@ 0 + 10 -- cgit v1.2.1