[gnome-control-center/add-locate-pointer: 92/92] universal-access: Add "Locate Pointer" option



commit ca291402bc4be0ef3bc41f5ced7d65fe04249f20
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Jul 29 14:33:50 2019 +0200

    universal-access: Add "Locate Pointer" option
    
    Since [0] and [1], "locate pointer" is now in Mutter and works
    well under Wayland and X11.
    
    Once activated, the mouse pointer can be located on the screen
    by pressing the Ctrl key. Pressing Ctrl will cause an animation
    to appear briefly at the location of your pointer.
    
    [0] https://gitlab.gnome.org/GNOME/mutter/merge_requests/453
    [1] https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/413
    
    Fixes #586

 panels/universal-access/cc-ua-panel.c  |  7 +++++++
 panels/universal-access/cc-ua-panel.ui | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
---
diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c
index aebdd572b..54c1570d7 100644
--- a/panels/universal-access/cc-ua-panel.c
+++ b/panels/universal-access/cc-ua-panel.c
@@ -49,6 +49,7 @@
 #define KEY_CURSOR_BLINKING          "cursor-blink"
 #define KEY_CURSOR_BLINKING_TIME     "cursor-blink-time"
 #define KEY_MOUSE_CURSOR_SIZE        "cursor-size"
+#define KEY_LOCATE_POINTER           "locate-pointer"
 
 /* application settings */
 #define APPLICATION_SETTINGS         "org.gnome.desktop.a11y.applications"
@@ -111,6 +112,7 @@ struct _CcUaPanel
   GtkWidget *list_seeing;
   GtkWidget *list_typing;
   GtkWidget *mouse_keys_switch;
+  GtkWidget *locate_pointer_switch;
   GtkWidget *pointing_dialog;
   GtkWidget *pointing_dwell_delay_box;
   GtkWidget *pointing_dwell_delay_scale;
@@ -251,6 +253,7 @@ cc_ua_panel_class_init (CcUaPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, list_seeing);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, list_typing);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, mouse_keys_switch);
+  gtk_widget_class_bind_template_child (widget_class, CcUaPanel, locate_pointer_switch);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dialog);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_delay_box);
   gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_delay_scale);
@@ -1050,6 +1053,10 @@ cc_ua_panel_init_mouse (CcUaPanel *self)
                    self->mouse_keys_switch, "active",
                    G_SETTINGS_BIND_DEFAULT);
 
+  g_settings_bind (self->interface_settings, KEY_LOCATE_POINTER,
+                   self->locate_pointer_switch, "active",
+                   G_SETTINGS_BIND_DEFAULT);
+
   g_signal_connect (self->mouse_settings, "changed",
                     G_CALLBACK (update_click_assist_label), self);
   update_click_assist_label (self->mouse_settings, NULL, self);
diff --git a/panels/universal-access/cc-ua-panel.ui b/panels/universal-access/cc-ua-panel.ui
index 4e9e2489c..ba77b79ad 100644
--- a/panels/universal-access/cc-ua-panel.ui
+++ b/panels/universal-access/cc-ua-panel.ui
@@ -881,6 +881,38 @@
                                         </child>
                                       </object>
                                     </child>
+                                    <child>
+                                      <object class="GtkListBoxRow">
+                                        <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="expand">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="margin">12</property>
+                                                <property name="xalign">0</property>
+                                                <property name="label" translatable="yes">_Locate 
Pointer</property>
+                                                <property name="use_underline">True</property>
+                                                <property 
name="mnemonic_widget">locate_pointer_switch</property>
+                                              </object>
+                                            </child>
+                                            <child>
+                                              <object class="GtkSwitch" id="locate_pointer_switch">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="margin">12</property>
+                                              </object>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
                                     <child>
                                       <object class="GtkListBoxRow" id="row_click_assist">
                                         <property name="visible">True</property>


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