inspector: Add a switch to turn off animations
This may be useful in some places to check that application-specific animations respect this setting.
This commit is contained in:
		@ -42,6 +42,7 @@ struct _GtkInspectorVisualPrivate
 | 
			
		||||
  GtkWidget *direction_combo;
 | 
			
		||||
  GtkWidget *font_button;
 | 
			
		||||
  GtkWidget *hidpi_spin;
 | 
			
		||||
  GtkWidget *animation_switch;
 | 
			
		||||
  GtkAdjustment *scale_adjustment;
 | 
			
		||||
 | 
			
		||||
  GtkWidget *debug_box;
 | 
			
		||||
@ -387,6 +388,14 @@ init_scale (GtkInspectorVisual *vis)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
init_animation (GtkInspectorVisual *vis)
 | 
			
		||||
{
 | 
			
		||||
  g_object_bind_property (gtk_settings_get_default (), "gtk-enable-animations",
 | 
			
		||||
                          vis->priv->animation_switch, "active",
 | 
			
		||||
                          G_BINDING_BIDIRECTIONAL|G_BINDING_SYNC_CREATE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
update_touchscreen (GtkSwitch *sw)
 | 
			
		||||
{
 | 
			
		||||
@ -469,6 +478,7 @@ gtk_inspector_visual_init (GtkInspectorVisual *vis)
 | 
			
		||||
  init_icons (vis);
 | 
			
		||||
  init_font (vis);
 | 
			
		||||
  init_scale (vis);
 | 
			
		||||
  init_animation (vis);
 | 
			
		||||
  init_touchscreen (vis);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -504,6 +514,7 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, theme_combo);
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, icon_combo);
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, hidpi_spin);
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, animation_switch);
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, scale_adjustment);
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, touchscreen_switch);
 | 
			
		||||
  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, visual_box);
 | 
			
		||||
 | 
			
		||||
@ -233,6 +233,39 @@
 | 
			
		||||
                    </child>
 | 
			
		||||
                  </object>
 | 
			
		||||
                </child>
 | 
			
		||||
                <child>
 | 
			
		||||
                  <object class="GtkListBoxRow">
 | 
			
		||||
                    <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" id="animation_label">
 | 
			
		||||
                            <property name="visible">True</property>
 | 
			
		||||
                            <property name="label" translatable="yes">Animations</property>
 | 
			
		||||
                            <property name="halign">start</property>
 | 
			
		||||
                            <property name="valign">baseline</property>
 | 
			
		||||
                            <property name="xalign">0.0</property>
 | 
			
		||||
                          </object>
 | 
			
		||||
                        </child>
 | 
			
		||||
                        <child>
 | 
			
		||||
                          <object class="GtkSwitch" id="animation_switch">
 | 
			
		||||
                            <property name="visible">True</property>
 | 
			
		||||
                            <property name="halign">end</property>
 | 
			
		||||
                            <property name="valign">baseline</property>
 | 
			
		||||
                          </object>
 | 
			
		||||
                          <packing>
 | 
			
		||||
                            <property name="expand">True</property>
 | 
			
		||||
                          </packing>
 | 
			
		||||
                        </child>
 | 
			
		||||
                      </object>
 | 
			
		||||
                    </child>
 | 
			
		||||
                  </object>
 | 
			
		||||
                </child>
 | 
			
		||||
              </object>
 | 
			
		||||
            </child>
 | 
			
		||||
          </object>
 | 
			
		||||
@ -396,6 +429,7 @@
 | 
			
		||||
      <widget name="font_label"/>
 | 
			
		||||
      <widget name="direction_label"/>
 | 
			
		||||
      <widget name="hidpi_label"/>
 | 
			
		||||
      <widget name="animation_label"/>
 | 
			
		||||
      <widget name="updates_label"/>
 | 
			
		||||
      <widget name="baselines_label"/>
 | 
			
		||||
      <widget name="pixelcache_label"/>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user