Merge lp:~azzar1/unity/rm-numlock-warn into lp:unity

Proposed by Andrea Azzarone on 2016-07-14
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2016-07-20
Approved revision: 4147
Merged at revision: 4154
Proposed branch: lp:~azzar1/unity/rm-numlock-warn
Merge into: lp:unity
Diff against target: 72 lines (+4/-16)
2 files modified
unity-shared/TextInput.cpp (+4/-15)
unity-shared/TextInput.h (+0/-1)
To merge this branch: bzr merge lp:~azzar1/unity/rm-numlock-warn
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2016-07-14 Approve on 2016-07-20
PS Jenkins bot continuous-integration Pending
Review via email: mp+300065@code.launchpad.net

Commit message

[LockSceen] Remove numlock warning.

To post a comment you must log in.
Marco Trevisan (Treviño) (3v1n0) wrote :

Ooook... It was a too hard experiment...

But why not enabling this when chassis type is desktop pc (as per https://www.freedesktop.org/wiki/Software/systemd/hostnamed/)?

Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, no.. Ok, in a laptop in case, but still it's something that is not valid for any kind of it, so let's get rid of this "feature" .

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-shared/TextInput.cpp'
2--- unity-shared/TextInput.cpp 2016-03-31 05:57:11 +0000
3+++ unity-shared/TextInput.cpp 2016-07-14 12:54:56 +0000
4@@ -104,7 +104,6 @@
5 , scale(1.0)
6 , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true))
7 , caps_lock_on(false)
8- , num_lock_on(false)
9 , last_width_(-1)
10 , last_height_(-1)
11 {
12@@ -146,9 +145,8 @@
13
14 // Caps lock warning
15 warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale)));
16- warning_->SetVisible(caps_lock_on() || num_lock_on());
17+ warning_->SetVisible(caps_lock_on());
18 layout_->AddView(warning_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
19- num_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));
20 caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));
21
22 show_lock_warnings.changed.connect(sigc::hide(sigc::mem_fun(this, &TextInput::CheckLocks)));
23@@ -249,7 +247,6 @@
24 {
25 GdkKeymap* keymap = gdk_keymap_get_default();
26 caps_lock_on = gdk_keymap_get_caps_lock_state(keymap) ? true : false;
27- num_lock_on = gdk_keymap_get_num_lock_state(keymap) ? true : false;
28 }
29
30 void TextInput::OnLockStateChanged(bool)
31@@ -260,8 +257,8 @@
32 return;
33 }
34
35- warning_->SetVisible(caps_lock_on() || num_lock_on());
36- warning_->SetOpacity((num_lock_on() && !caps_lock_on()) ? 0.3 : 1.0);
37+ warning_->SetVisible(caps_lock_on());
38+ warning_->SetOpacity(1.0);
39 warning_tooltip_.Release();
40 QueueRelayout();
41 QueueDraw();
42@@ -345,18 +342,10 @@
43
44 pango_layout_set_height(layout, -1); //avoid wrap lines
45
46- if (caps_lock_on() && num_lock_on())
47- {
48- pango_layout_set_text(layout, _("Caps lock and Num lock are on"), -1);
49- }
50- else if (caps_lock_on())
51+ if (caps_lock_on())
52 {
53 pango_layout_set_text(layout, _("Caps lock is on"), -1);
54 }
55- else if (num_lock_on())
56- {
57- pango_layout_set_text(layout, _("Num lock is on"), -1);
58- }
59
60 nux::Size extents;
61 pango_layout_get_pixel_size(layout, &extents.width, &extents.height);
62
63=== modified file 'unity-shared/TextInput.h'
64--- unity-shared/TextInput.h 2016-03-31 05:57:11 +0000
65+++ unity-shared/TextInput.h 2016-07-14 12:54:56 +0000
66@@ -124,7 +124,6 @@
67 SearchBarSpinner* spinner_;
68
69 nux::Property<bool> caps_lock_on;
70- nux::Property<bool> num_lock_on;
71 int last_width_;
72 int last_height_;
73