[gnome-control-center/add-enable-animation-toggle: 2/2] universal-access: Add "Enable Animations" option




commit a825ded085939d5030e7e392f999668fc730ede8
Author: Felipe Borges <felipeborges gnome org>
Date:   Wed Jul 7 16:33:28 2021 +0200

    universal-access: Add "Enable Animations" option
    
    Fixes #1388

 panels/universal-access/cc-ua-panel.c  |  9 ++++++++
 panels/universal-access/cc-ua-panel.ui | 38 ++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
---
diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c
index 2cd94c59d..990960ac4 100644
--- a/panels/universal-access/cc-ua-panel.c
+++ b/panels/universal-access/cc-ua-panel.c
@@ -57,6 +57,7 @@
 #define KEY_CURSOR_BLINKING_TIME     "cursor-blink-time"
 #define KEY_MOUSE_CURSOR_SIZE        "cursor-size"
 #define KEY_LOCATE_POINTER           "locate-pointer"
+#define KEY_ENABLE_ANIMATIONS        "enable-animations"
 
 /* application settings */
 #define APPLICATION_SETTINGS         "org.gnome.desktop.a11y.applications"
@@ -117,6 +118,7 @@ struct _CcUaPanel
   GtkLabel          *cursor_size_label;
   GtkListBoxRow     *cursor_size_row;
   GtkScale          *double_click_delay_scale;
+  GtkSwitch         *enable_animations_switch;
   GtkListBox        *hearing_listbox;
   GtkSwitch         *highcontrast_enable_switch;
   GtkListBoxRow     *highcontrast_row;
@@ -210,6 +212,7 @@ cc_ua_panel_class_init (CcUaPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, cursor_size_label);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, cursor_size_row);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, double_click_delay_scale);
+  gtk_widget_class_bind_template_child (widget_class, CcUaPanel, enable_animations_switch);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, hearing_listbox);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, highcontrast_enable_switch);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, highcontrast_row);
@@ -530,6 +533,12 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
                                 self,
                                 NULL);
 
+  /* enable animation */
+  g_settings_bind (self->interface_settings, KEY_ENABLE_ANIMATIONS,
+                   self->enable_animations_switch, "active",
+                   G_SETTINGS_BIND_DEFAULT);
+
+
   /* large text */
 
   g_settings_bind_with_mapping (self->interface_settings, KEY_TEXT_SCALING_FACTOR,
diff --git a/panels/universal-access/cc-ua-panel.ui b/panels/universal-access/cc-ua-panel.ui
index 4aaddfa06..67104cee2 100644
--- a/panels/universal-access/cc-ua-panel.ui
+++ b/panels/universal-access/cc-ua-panel.ui
@@ -216,6 +216,44 @@
                                         </child>
                                       </object>
                                     </child>
+                                    <child>
+                                      <object class="GtkListBoxRow" id="enable_animations_row">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="selectable">False</property>
+                                        <property name="activatable">False</property>
+                                        <child>
+                                          <object class="GtkBox">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="margin_start">12</property>
+                                                <property name="margin_end">12</property>
+                                                <property name="margin_top">12</property>
+                                                <property name="margin_bottom">12</property>
+                                                <property name="xalign">0</property>
+                                                <property name="hexpand">True</property>
+                                                <property name="label" translatable="yes">Enable 
A_nimations</property>
+                                                <property name="use_underline">True</property>
+                                                <property 
name="mnemonic_widget">enable_animations_switch</property>
+                                              </object>
+                                            </child>
+                                            <child>
+                                              <object class="GtkSwitch" id="enable_animations_switch">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="margin_start">12</property>
+                                                <property name="margin_end">12</property>
+                                                <property name="margin_top">12</property>
+                                                <property name="margin_bottom">12</property>
+                                              </object>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
                                     <child>
                                       <object class="GtkListBoxRow" id="cursor_size_row">
                                         <property name="visible">True</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]