Merge lp:~elementary-pantheon/switchboard-plug-keyboard/scale-snaps into lp:~elementary-pantheon/switchboard-plug-keyboard/trunk

Proposed by Daniel Fore on 2017-02-22
Status: Merged
Approved by: David Hewitt on 2017-03-12
Approved revision: 521
Merged at revision: 527
Proposed branch: lp:~elementary-pantheon/switchboard-plug-keyboard/scale-snaps
Merge into: lp:~elementary-pantheon/switchboard-plug-keyboard/trunk
Diff against target: 52 lines (+11/-5)
1 file modified
src/Views/Behavior.vala (+11/-5)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-keyboard/scale-snaps
Reviewer Review Type Date Requested Status
David Hewitt code, function 2017-02-22 Approve on 2017-03-12
Review via email: mp+318016@code.launchpad.net

Commit message

Behavior.vala:
* Use construct
* Give scales sane min and max values
* Add snaps at default positions and multiples of defaults

Description of the change

The goal of this branch is to:
* Make it easy to revert to the default value
* Give the scale some kind of sanity in terms of minimum and maximum values. This means making our default values fit into some sane divisor of the scale max value

To post a comment you must log in.
David Hewitt (davidmhewitt) wrote :

Much more user friendly to be able to snap back to known good values.

review: Approve (code, function)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Views/Behavior.vala'
2--- src/Views/Behavior.vala 2017-02-19 01:38:44 +0000
3+++ src/Views/Behavior.vala 2017-02-22 17:52:10 +0000
4@@ -14,7 +14,7 @@
5 return;
6 }
7
8- public Page () {
9+ construct {
10 var settings_repeat = new Behaviour.SettingsRepeat ();
11 var settings_blink = new Behaviour.SettingsBlink ();
12
13@@ -43,14 +43,17 @@
14 switch_repeat.halign = Gtk.Align.START;
15 switch_repeat.valign = Gtk.Align.CENTER;
16
17- var scale_repeat_delay = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 10, 1000, 1);
18+ var scale_repeat_delay = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 100, 900, 1);
19 scale_repeat_delay.draw_value = false;
20 scale_repeat_delay.hexpand = true;
21+ scale_repeat_delay.add_mark (500, Gtk.PositionType.BOTTOM, null);
22 scale_repeat_delay.set_value (double_delay);
23
24- var scale_repeat_speed = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 10, 100, 1);
25+ var scale_repeat_speed = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 10, 70, 1);
26 scale_repeat_speed.draw_value = false;
27 scale_repeat_speed.hexpand = true;
28+ scale_repeat_speed.add_mark (30, Gtk.PositionType.BOTTOM, null);
29+ scale_repeat_speed.add_mark (50, Gtk.PositionType.BOTTOM, null);
30 scale_repeat_speed.set_value (double_speed);
31
32 var spin_repeat_delay = new Gtk.SpinButton.with_range (10, 1000, 1);
33@@ -81,14 +84,17 @@
34 switch_blink.valign = Gtk.Align.CENTER;
35 switch_blink.margin_top = 24;
36
37- var scale_blink_speed = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 100, 2500, 10);
38+ var scale_blink_speed = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 100, 2300, 10);
39 scale_blink_speed.draw_value = false;
40 scale_blink_speed.hexpand = true;
41+ scale_blink_speed.add_mark (1200, Gtk.PositionType.BOTTOM, null);
42 scale_blink_speed.set_value (double_blink_speed);
43
44- var scale_blink_time = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 1, 100, 1);
45+ var scale_blink_time = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 1, 29, 1);
46 scale_blink_time.draw_value = false;
47 scale_blink_time.hexpand = true;
48+ scale_blink_time.add_mark (10, Gtk.PositionType.BOTTOM, null);
49+ scale_blink_time.add_mark (20, Gtk.PositionType.BOTTOM, null);
50 scale_blink_time.set_value (double_blink_time);
51
52 var spin_blink_speed = new Gtk.SpinButton.with_range (100, 2500, 10);

Subscribers

People subscribed via source and target branches