summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bicha <jbicha@ubuntu.com>2019-01-03 17:12:09 -0500
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-01-29 10:43:23 +0000
commitdde97ecb2ed695088504c1074c8435a4fc37bcaf (patch)
treef08507bc24390e48ab19365aed45db70dfdff265
parent783918aaf552111a496fc33fee3fda800a007753 (diff)
downloadgnome-control-center-dde97ecb2ed695088504c1074c8435a4fc37bcaf.tar.gz
mouse: Don't use a separate box for touchpad switch
The Touchpad section looks like a single listbox so let's handle it that way too. This eliminates an unnecessary split in the touchpad section that is noticeable when navigating with a keyboard.
-rw-r--r--panels/mouse/gnome-mouse-properties.c37
-rw-r--r--panels/mouse/gnome-mouse-properties.ui13
2 files changed, 32 insertions, 18 deletions
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index e74a59761..102778f42 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -60,8 +60,9 @@ struct _CcMouseProperties
GtkWidget *tap_to_click_switch;
GtkWidget *touchpad_frame;
GtkWidget *touchpad_listbox;
+ GtkWidget *touchpad_natural_scrolling_row;
GtkWidget *touchpad_natural_scrolling_switch;
- GtkWidget *touchpad_options_listbox;
+ GtkWidget *touchpad_speed_row;
GtkWidget *touchpad_speed_scale;
GtkWidget *touchpad_toggle_switch;
GtkWidget *two_finger_scrolling_row;
@@ -280,7 +281,31 @@ setup_dialog (CcMouseProperties *self)
touchpad_enabled_set_mapping,
NULL, NULL);
g_settings_bind_with_mapping (self->touchpad_settings, "send-events",
- self->touchpad_options_listbox, "sensitive",
+ self->touchpad_natural_scrolling_row, "sensitive",
+ G_SETTINGS_BIND_GET,
+ touchpad_enabled_get_mapping,
+ touchpad_enabled_set_mapping,
+ NULL, NULL);
+ g_settings_bind_with_mapping (self->touchpad_settings, "send-events",
+ self->touchpad_speed_row, "sensitive",
+ G_SETTINGS_BIND_GET,
+ touchpad_enabled_get_mapping,
+ touchpad_enabled_set_mapping,
+ NULL, NULL);
+ g_settings_bind_with_mapping (self->touchpad_settings, "send-events",
+ self->tap_to_click_row, "sensitive",
+ G_SETTINGS_BIND_GET,
+ touchpad_enabled_get_mapping,
+ touchpad_enabled_set_mapping,
+ NULL, NULL);
+ g_settings_bind_with_mapping (self->touchpad_settings, "send-events",
+ self->two_finger_scrolling_row, "sensitive",
+ G_SETTINGS_BIND_GET,
+ touchpad_enabled_get_mapping,
+ touchpad_enabled_set_mapping,
+ NULL, NULL);
+ g_settings_bind_with_mapping (self->touchpad_settings, "send-events",
+ self->edge_scrolling_row, "sensitive",
G_SETTINGS_BIND_GET,
touchpad_enabled_get_mapping,
touchpad_enabled_set_mapping,
@@ -299,8 +324,6 @@ setup_dialog (CcMouseProperties *self)
G_SETTINGS_BIND_DEFAULT);
setup_touchpad_options (self);
-
- gtk_list_box_set_header_func (GTK_LIST_BOX (self->touchpad_options_listbox), cc_list_box_update_header_func, NULL, NULL);
}
/* Callback issued when a button is clicked on the dialog */
@@ -379,8 +402,12 @@ cc_mouse_properties_class_init (CcMousePropertiesClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, tap_to_click_switch);
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_frame);
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_listbox);
+ gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_natural_scrolling_row);
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_natural_scrolling_switch);
- gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_options_listbox);
+ gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_speed_row);
+ gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, tap_to_click_row);
+ gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, two_finger_scrolling_row);
+ gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, edge_scrolling_row);
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_speed_scale);
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, touchpad_toggle_switch);
gtk_widget_class_bind_template_child (widget_class, CcMouseProperties, two_finger_scrolling_row);
diff --git a/panels/mouse/gnome-mouse-properties.ui b/panels/mouse/gnome-mouse-properties.ui
index cd25b1ff0..1932b91b1 100644
--- a/panels/mouse/gnome-mouse-properties.ui
+++ b/panels/mouse/gnome-mouse-properties.ui
@@ -418,19 +418,6 @@
</child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">true</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- <child>
- <object class="GtkListBox" id="touchpad_options_listbox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="selection_mode">none</property>
<child>
<object class="GtkListBoxRow" id="touchpad_natural_scrolling_row">
<property name="visible">True</property>