Merge lp:~unity-team/unity/trusty-1332509 into lp:unity/7.2

Proposed by Stephen M. Webb
Status: Rejected
Rejected by: Stephen M. Webb
Proposed branch: lp:~unity-team/unity/trusty-1332509
Merge into: lp:unity/7.2
Diff against target: 129 lines (+38/-0)
4 files modified
debian/changelog (+6/-0)
lockscreen/UserPromptView.cpp (+1/-0)
unity-shared/TextInput.cpp (+28/-0)
unity-shared/TextInput.h (+3/-0)
To merge this branch: bzr merge lp:~unity-team/unity/trusty-1332509
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+244127@code.launchpad.net

Commit message

add an arrow activator in the lockscreen

Description of the change

Adds an arrow activator in the lockscreen (lp: #1332509).

This change is cherry-picked from trunk for SRUing into Ubuntu 14.04 LTS.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-26 13:49:00 +0000
3+++ debian/changelog 2014-12-09 13:24:56 +0000
4@@ -1,3 +1,9 @@
5+unity (7.2.3+14.04.20140826-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ * Add an arrow activator in the lockscreen. (lp: #1332509)
8+
9+ -- Andrea Azzarone <azzaronea@gmail.com> Tue, 09 Dec 2014 08:19:40 -0500
10+
11 unity (7.2.3+14.04.20140826-0ubuntu1) trusty; urgency=medium
12
13 [ Andrea Azzarone ]
14
15=== modified file 'lockscreen/UserPromptView.cpp'
16--- lockscreen/UserPromptView.cpp 2014-07-24 14:03:10 +0000
17+++ lockscreen/UserPromptView.cpp 2014-12-09 13:24:56 +0000
18@@ -241,6 +241,7 @@
19 text_input->input_hint = SanitizeMessage(message);
20 text_input->hint_font_size = PROMPT_FONT_SIZE;
21 text_input->show_caps_lock = true;
22+ text_input->show_activator = true;
23 text_entry->SetPasswordMode(!visible);
24 text_entry->SetPasswordChar("•");
25 text_entry->SetToggleCursorVisibilityOnKeyFocus(true);
26
27=== added file 'resources/arrow_right.png'
28Binary files resources/arrow_right.png 1970-01-01 00:00:00 +0000 and resources/arrow_right.png 2014-12-09 13:24:56 +0000 differ
29=== modified file 'unity-shared/TextInput.cpp'
30--- unity-shared/TextInput.cpp 2014-08-06 14:15:32 +0000
31+++ unity-shared/TextInput.cpp 2014-12-09 13:24:56 +0000
32@@ -22,6 +22,7 @@
33 #include "unity-shared/DashStyle.h"
34 #include "unity-shared/RawPixel.h"
35 #include "unity-shared/PreviewStyle.h"
36+#include "unity-shared/TextureCache.h"
37
38 namespace unity
39 {
40@@ -82,6 +83,7 @@
41 , input_hint("")
42 , hint_font_name(HINT_LABEL_DEFAULT_FONT_NAME)
43 , hint_font_size(HINT_LABEL_FONT_SIZE)
44+ , show_activator(false)
45 , show_caps_lock(false)
46 , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true))
47 , caps_lock_on(false)
48@@ -121,6 +123,7 @@
49 layered_layout_->SetActiveLayerN(1);
50 layout_->AddView(layered_layout_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
51
52+ // Caps lock warning
53 warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE));
54 warning_->SetVisible(caps_lock_on());
55 layout_->AddView(warning_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
56@@ -140,6 +143,20 @@
57 CheckIfCapsLockOn();
58 });
59
60+ // Activator
61+ activator_ = new IconTexture(LoadActivatorIcon(DEFAULT_ICON_SIZE));
62+ activator_->SetVisible(show_activator());
63+ layout_->AddView(activator_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
64+
65+ show_activator.changed.connect([this] (bool value) {
66+ activator_->SetVisible(value);
67+ });
68+
69+ activator_->mouse_click.connect([this](int, int, unsigned long, unsigned long) {
70+ pango_entry_->activated.emit();
71+ });
72+
73+ // Spinner
74 spinner_ = new SearchBarSpinner();
75 spinner_->SetVisible(false);
76 spinner_->SetMinMaxSize(22, 22);
77@@ -179,6 +196,11 @@
78 void TextInput::SetSpinnerVisible(bool visible)
79 {
80 spinner_->SetVisible(visible);
81+
82+ if (visible)
83+ activator_->SetVisible(false);
84+ else
85+ activator_->SetVisible(show_activator());
86 }
87
88 void TextInput::SetSpinnerState(SpinnerState spinner_state)
89@@ -191,6 +213,12 @@
90 hint_->SetFont((hint_font_name() + " " + std::to_string(hint_font_size())).c_str());
91 }
92
93+nux::ObjectPtr<nux::BaseTexture> TextInput::LoadActivatorIcon(int icon_size)
94+{
95+ TextureCache& cache = TextureCache::GetDefault();
96+ return cache.FindTexture("arrow_right.png", icon_size, icon_size);
97+}
98+
99 nux::ObjectPtr<nux::BaseTexture> TextInput::LoadWarningIcon(int icon_size)
100 {
101 auto* theme = gtk_icon_theme_get_default();
102
103=== modified file 'unity-shared/TextInput.h'
104--- unity-shared/TextInput.h 2014-08-06 14:15:32 +0000
105+++ unity-shared/TextInput.h 2014-12-09 13:24:56 +0000
106@@ -72,6 +72,7 @@
107 nux::Property<int> hint_font_size;
108 nux::ROProperty<bool> im_active;
109 nux::ROProperty<bool> im_preedit;
110+ nux::Property<bool> show_activator;
111 nux::Property<bool> show_caps_lock;
112
113 private:
114@@ -91,6 +92,7 @@
115 nux::Geometry GetWaringIconGeometry() const;
116 void CheckIfCapsLockOn();
117
118+ nux::ObjectPtr<nux::BaseTexture> LoadActivatorIcon(int icon_size);
119 nux::ObjectPtr<nux::BaseTexture> LoadWarningIcon(int icon_size);
120 void LoadWarningTooltip();
121
122@@ -125,6 +127,7 @@
123 bool mouse_over_warning_icon_;
124
125 IconTexture* warning_;
126+ IconTexture* activator_;
127 nux::ObjectPtr<nux::BaseTexture> warning_tooltip_;
128
129 glib::SignalManager sig_manager_;

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: