Merge lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/natural-scroll-mouse into lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 76
Merged at revision: 84
Proposed branch: lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/natural-scroll-mouse
Merge into: lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/trunk
Diff against target: 35 lines (+9/-0)
1 file modified
src/Widgets/MouseSection.vala (+9/-0)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/natural-scroll-mouse
Reviewer Review Type Date Requested Status
Corentin Noël Needs Information
Review via email: mp+300442@code.launchpad.net

Commit message

Add natural scrolling setting for mouse

Description of the change

This toggles the setting, but someone with a mouse should confirm that it actually works

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

For mouses it's not "Natural" it's reversed

review: Needs Information
76. By Danielle Foré

merge trunk

Revision history for this message
Danielle Foré (danrabbit) wrote :

i don't think it makes sense to have two different labels for a switch that effectively does the same thing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/MouseSection.vala'
--- src/Widgets/MouseSection.vala 2016-07-19 10:20:45 +0000
+++ src/Widgets/MouseSection.vala 2016-07-19 10:25:35 +0000
@@ -21,6 +21,7 @@
21 private Backend.MouseSettings mouse_settings;21 private Backend.MouseSettings mouse_settings;
2222
23 private Gtk.Scale pointer_speed_scale;23 private Gtk.Scale pointer_speed_scale;
24 private Gtk.Switch natural_scrolling_switch;
2425
25 public MouseSection (Backend.MouseSettings mouse_settings) {26 public MouseSection (Backend.MouseSettings mouse_settings) {
26 base (_("Mouse"));27 base (_("Mouse"));
@@ -37,8 +38,11 @@
37 pointer_speed_scale.digits = 2;38 pointer_speed_scale.digits = 2;
38 pointer_speed_scale.draw_value = false;39 pointer_speed_scale.draw_value = false;
39 pointer_speed_scale.set_size_request (160, -1);40 pointer_speed_scale.set_size_request (160, -1);
41 natural_scrolling_switch = new Gtk.Switch ();
42 natural_scrolling_switch.halign = Gtk.Align.START;
4043
41 this.add_entry (_("Pointer speed:"), pointer_speed_scale);44 this.add_entry (_("Pointer speed:"), pointer_speed_scale);
45 this.add_entry (_("Natural scrolling:"), natural_scrolling_switch);
42 }46 }
4347
44 private void create_bindings () {48 private void create_bindings () {
@@ -47,6 +51,11 @@
47 "speed",51 "speed",
48 BindingFlags.SYNC_CREATE,52 BindingFlags.SYNC_CREATE,
49 pointer_speed_scale_transform_func);53 pointer_speed_scale_transform_func);
54
55 mouse_settings.bind_property ("natural-scroll",
56 natural_scrolling_switch,
57 "state",
58 BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
50 }59 }
5160
52 private bool pointer_speed_scale_transform_func (Binding binding, Value source_value, ref Value target_value) {61 private bool pointer_speed_scale_transform_func (Binding binding, Value source_value, ref Value target_value) {

Subscribers

People subscribed via source and target branches