[gnome-control-center] mouse: Remove the two-finger scroll switch



commit 07c6c4d3f749893af17506ae036f59456efc9c15
Author: Felipe Borges <feborges redhat com>
Date:   Fri Dec 11 12:05:00 2015 +0100

    mouse: Remove the two-finger scroll switch
    
    The two-finger scroll method will be enabled in all cases
    (see bgo#759304). When a touchpad without two-finger scrolling
    support but with edge scrolling support is available, show the
    switch.
    
    Also bump the required gsettings-desktop-schemas version for
    the new key.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759307

 configure.ac                           |    2 +-
 panels/mouse/gnome-mouse-properties.c  |   32 ++------------------
 panels/mouse/gnome-mouse-properties.ui |   50 --------------------------------
 3 files changed, 5 insertions(+), 79 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c803acd..6fbdc53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,7 @@ NETWORK_MANAGER_APPLET_REQUIRED_VERSION=0.9.7.995
 MODEM_MANAGER_REQUIRED_VERSION=0.7
 LIBNOTIFY_REQUIRED_VERSION=0.7.3
 GNOME_DESKTOP_REQUIRED_VERSION=3.17.4
-SCHEMAS_REQUIRED_VERSION=3.15.4
+SCHEMAS_REQUIRED_VERSION=3.19.3
 LIBWACOM_REQUIRED_VERSION=0.7
 CLUTTER_REQUIRED_VERSION=1.11.3
 GOA_REQUIRED_VERSION=3.15.1
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index a543a51..612d040 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -74,7 +74,7 @@ G_DEFINE_TYPE (CcMouseProperties, cc_mouse_properties, GTK_TYPE_BIN);
 static void
 setup_touchpad_options (CcMousePropertiesPrivate *d)
 {
-       GsdTouchpadScrollMethod method;
+       gboolean edge_scroll_enabled;
        gboolean have_two_finger_scrolling;
        gboolean have_edge_scrolling;
        gboolean have_tap_to_click;
@@ -83,31 +83,11 @@ setup_touchpad_options (CcMousePropertiesPrivate *d)
 
        gtk_widget_show_all (WID ("touchpad-frame"));
 
-       gtk_widget_set_visible (WID ("two-finger-scrolling-row"), have_two_finger_scrolling);
        gtk_widget_set_visible (WID ("edge-scrolling-row"), have_edge_scrolling && 
!have_two_finger_scrolling);
        gtk_widget_set_visible (WID ("tap-to-click-row"), have_tap_to_click);
 
-       method = g_settings_get_enum (d->touchpad_settings, "scroll-method");
-       gtk_switch_set_active (GTK_SWITCH (WID ("two-finger-scrolling-switch")),
-                              method == GSD_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING);
-
-       gtk_switch_set_active (GTK_SWITCH (WID ("edge-scrolling-switch")),
-                              method == GSD_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING);
-}
-
-static void
-two_finger_scrollmethod_changed_event (GtkSwitch *button,
-                                      gboolean   state,
-                                      gpointer   user_data)
-{
-       CcMousePropertiesPrivate *d = user_data;
-
-       if (d->changing_scroll)
-               return;
-
-       g_settings_set_enum (d->touchpad_settings, "scroll-method",
-                            state ? GSD_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING : 
GSD_TOUCHPAD_SCROLL_METHOD_DISABLED);
-       gtk_switch_set_state (button, state);
+       edge_scroll_enabled = g_settings_get_boolean (d->touchpad_settings, "edge-scrolling-enabled");
+       gtk_switch_set_active (GTK_SWITCH (WID ("edge-scrolling-switch")), edge_scroll_enabled);
 }
 
 static void
@@ -120,8 +100,7 @@ edge_scrolling_changed_event (GtkSwitch *button,
        if (d->changing_scroll)
                return;
 
-       g_settings_set_enum (d->touchpad_settings, "scroll-method",
-                            state ? GSD_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING : 
GSD_TOUCHPAD_SCROLL_METHOD_DISABLED);
+       g_settings_set_boolean (d->touchpad_settings, "edge-scrolling-switch", state);
        gtk_switch_set_state (button, state);
 }
 
@@ -263,9 +242,6 @@ setup_dialog (CcMousePropertiesPrivate *d)
        if (d->have_touchpad)
                setup_touchpad_options (d);
 
-       g_signal_connect (WID ("two-finger-scrolling-switch"), "state-set",
-                         G_CALLBACK (two_finger_scrollmethod_changed_event), d);
-
        g_signal_connect (WID ("edge-scrolling-switch"), "state-set",
                          G_CALLBACK (edge_scrolling_changed_event), d);
 
diff --git a/panels/mouse/gnome-mouse-properties.ui b/panels/mouse/gnome-mouse-properties.ui
index ae3a6bd..4af876b 100644
--- a/panels/mouse/gnome-mouse-properties.ui
+++ b/panels/mouse/gnome-mouse-properties.ui
@@ -614,56 +614,6 @@
                               </object>
                             </child>
                             <child>
-                              <object class="GtkListBoxRow" id="two-finger-scrolling-row">
-                                <property name="visible">False</property>
-                                <property name="can_focus">True</property>
-                                <property name="no_show_all">True</property>
-                                <child>
-                                  <object class="GtkGrid" id="two-finger-scrolling-grid">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="row_spacing">0</property>
-                                    <property name="column_spacing">32</property>
-                                    <property name="margin_start">12</property>
-                                    <property name="margin_end">6</property>
-                                    <property name="margin_top">6</property>
-                                    <property name="margin_bottom">6</property>
-                                    <child>
-                                      <object class="GtkLabel" id="two-finger-scrolling-label">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="hexpand">True</property>
-                                        <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">Two Finger 
Scrolling</property>
-                                        <property name="use_underline">True</property>
-                                        <property 
name="mnemonic_widget">two-finger-scrolling-switch</property>
-                                      </object>
-                                      <packing>
-                                        <property name="left_attach">0</property>
-                                        <property name="top_attach">0</property>
-                                        <property name="width">1</property>
-                                        <property name="height">1</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkSwitch" id="two-finger-scrolling-switch">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="halign">end</property>
-                                        <property name="valign">center</property>
-                                      </object>
-                                      <packing>
-                                        <property name="left_attach">1</property>
-                                        <property name="top_attach">0</property>
-                                        <property name="width">1</property>
-                                        <property name="height">2</property>
-                                      </packing>
-                                    </child>
-                                  </object>
-                                </child>
-                              </object>
-                            </child>
-                            <child>
                               <object class="GtkListBoxRow" id="edge-scrolling-row">
                                 <property name="visible">False</property>
                                 <property name="can_focus">True</property>


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