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
1=== modified file 'src/Widgets/MouseSection.vala'
2--- src/Widgets/MouseSection.vala 2016-07-19 10:20:45 +0000
3+++ src/Widgets/MouseSection.vala 2016-07-19 10:25:35 +0000
4@@ -21,6 +21,7 @@
5 private Backend.MouseSettings mouse_settings;
6
7 private Gtk.Scale pointer_speed_scale;
8+ private Gtk.Switch natural_scrolling_switch;
9
10 public MouseSection (Backend.MouseSettings mouse_settings) {
11 base (_("Mouse"));
12@@ -37,8 +38,11 @@
13 pointer_speed_scale.digits = 2;
14 pointer_speed_scale.draw_value = false;
15 pointer_speed_scale.set_size_request (160, -1);
16+ natural_scrolling_switch = new Gtk.Switch ();
17+ natural_scrolling_switch.halign = Gtk.Align.START;
18
19 this.add_entry (_("Pointer speed:"), pointer_speed_scale);
20+ this.add_entry (_("Natural scrolling:"), natural_scrolling_switch);
21 }
22
23 private void create_bindings () {
24@@ -47,6 +51,11 @@
25 "speed",
26 BindingFlags.SYNC_CREATE,
27 pointer_speed_scale_transform_func);
28+
29+ mouse_settings.bind_property ("natural-scroll",
30+ natural_scrolling_switch,
31+ "state",
32+ BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
33 }
34
35 private bool pointer_speed_scale_transform_func (Binding binding, Value source_value, ref Value target_value) {

Subscribers

People subscribed via source and target branches