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

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
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) Approve
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.
Revision history for this message
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/)?

Revision history for this message
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
=== modified file 'unity-shared/TextInput.cpp'
--- unity-shared/TextInput.cpp 2016-03-31 05:57:11 +0000
+++ unity-shared/TextInput.cpp 2016-07-14 12:54:56 +0000
@@ -104,7 +104,6 @@
104 , scale(1.0)104 , scale(1.0)
105 , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true))105 , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true))
106 , caps_lock_on(false)106 , caps_lock_on(false)
107 , num_lock_on(false)
108 , last_width_(-1)107 , last_width_(-1)
109 , last_height_(-1)108 , last_height_(-1)
110{109{
@@ -146,9 +145,8 @@
146145
147 // Caps lock warning146 // Caps lock warning
148 warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale)));147 warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale)));
149 warning_->SetVisible(caps_lock_on() || num_lock_on());148 warning_->SetVisible(caps_lock_on());
150 layout_->AddView(warning_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);149 layout_->AddView(warning_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
151 num_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));
152 caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));150 caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));
153151
154 show_lock_warnings.changed.connect(sigc::hide(sigc::mem_fun(this, &TextInput::CheckLocks)));152 show_lock_warnings.changed.connect(sigc::hide(sigc::mem_fun(this, &TextInput::CheckLocks)));
@@ -249,7 +247,6 @@
249{247{
250 GdkKeymap* keymap = gdk_keymap_get_default();248 GdkKeymap* keymap = gdk_keymap_get_default();
251 caps_lock_on = gdk_keymap_get_caps_lock_state(keymap) ? true : false;249 caps_lock_on = gdk_keymap_get_caps_lock_state(keymap) ? true : false;
252 num_lock_on = gdk_keymap_get_num_lock_state(keymap) ? true : false;
253}250}
254251
255void TextInput::OnLockStateChanged(bool)252void TextInput::OnLockStateChanged(bool)
@@ -260,8 +257,8 @@
260 return;257 return;
261 }258 }
262259
263 warning_->SetVisible(caps_lock_on() || num_lock_on());260 warning_->SetVisible(caps_lock_on());
264 warning_->SetOpacity((num_lock_on() && !caps_lock_on()) ? 0.3 : 1.0);261 warning_->SetOpacity(1.0);
265 warning_tooltip_.Release();262 warning_tooltip_.Release();
266 QueueRelayout();263 QueueRelayout();
267 QueueDraw();264 QueueDraw();
@@ -345,18 +342,10 @@
345342
346 pango_layout_set_height(layout, -1); //avoid wrap lines343 pango_layout_set_height(layout, -1); //avoid wrap lines
347344
348 if (caps_lock_on() && num_lock_on())345 if (caps_lock_on())
349 {
350 pango_layout_set_text(layout, _("Caps lock and Num lock are on"), -1);
351 }
352 else if (caps_lock_on())
353 {346 {
354 pango_layout_set_text(layout, _("Caps lock is on"), -1);347 pango_layout_set_text(layout, _("Caps lock is on"), -1);
355 }348 }
356 else if (num_lock_on())
357 {
358 pango_layout_set_text(layout, _("Num lock is on"), -1);
359 }
360349
361 nux::Size extents;350 nux::Size extents;
362 pango_layout_get_pixel_size(layout, &extents.width, &extents.height);351 pango_layout_get_pixel_size(layout, &extents.width, &extents.height);
363352
=== modified file 'unity-shared/TextInput.h'
--- unity-shared/TextInput.h 2016-03-31 05:57:11 +0000
+++ unity-shared/TextInput.h 2016-07-14 12:54:56 +0000
@@ -124,7 +124,6 @@
124 SearchBarSpinner* spinner_;124 SearchBarSpinner* spinner_;
125125
126 nux::Property<bool> caps_lock_on;126 nux::Property<bool> caps_lock_on;
127 nux::Property<bool> num_lock_on;
128 int last_width_;127 int last_width_;
129 int last_height_;128 int last_height_;
130129