Merge lp:~gordallott/unity/keynav-fixes-11-03-10 into lp:unity

Proposed by Gord Allott
Status: Merged
Merged at revision: 943
Proposed branch: lp:~gordallott/unity/keynav-fixes-11-03-10
Merge into: lp:unity
Prerequisite: lp:~unity-team/unity/various-fixes-2011-03-08
Diff against target: 454 lines (+120/-34)
14 files modified
src/IconTexture.cpp (+2/-1)
src/IconTexture.h (+2/-3)
src/PlacesGroup.cpp (+60/-13)
src/PlacesGroup.h (+4/-0)
src/PlacesResultsView.cpp (+19/-0)
src/PlacesResultsView.h (+2/-0)
src/PlacesSearchBar.cpp (+4/-6)
src/PlacesSearchBar.h (+0/-2)
src/PlacesTile.cpp (+7/-0)
src/PlacesTile.h (+2/-2)
src/PlacesView.cpp (+15/-1)
src/StaticCairoText.cpp (+1/-5)
src/StaticCairoText.h (+0/-1)
tests/TestPlaces.cpp (+2/-0)
To merge this branch: bzr merge lp:~gordallott/unity/keynav-fixes-11-03-10
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+52843@code.launchpad.net

Description of the change

Bunch of keynav fixes - still a few issues;

Can't click to focus the search bar anymore, not sure why, but as a consequence you don't get a cursor
when keynav is used on a group that has more items than are visible, you can navigate "into" that group, effectively losing focus on your keynav - should be fixed once groups are updated to not create more items than they can fit or groups at least make the items return false on IsVisible (); - unity bug not a keynav one
Keynav doesn't scroll the window
Combo-box isn't supported so you can't keynav to that yet.

requires https://code.launchpad.net/~gordallott/nux/keynav-fixes-11-03-10/+merge/52842

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Very, very cool, works well and we can fix the remaining things for next week. Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/IconTexture.cpp'
--- src/IconTexture.cpp 2011-03-01 09:22:43 +0000
+++ src/IconTexture.cpp 2011-03-10 15:06:55 +0000
@@ -46,6 +46,7 @@
46 LoadIcon ();46 LoadIcon ();
4747
48 _can_pass_focus_to_composite_layout = false;48 _can_pass_focus_to_composite_layout = false;
49 SetCanFocus (false);
49}50}
5051
51IconTexture::~IconTexture ()52IconTexture::~IconTexture ()
@@ -187,7 +188,7 @@
187}188}
188189
189bool190bool
190IconTexture::CanFocus ()191IconTexture::DoCanFocus ()
191{192{
192 return false;193 return false;
193}194}
194195
=== modified file 'src/IconTexture.h'
--- src/IconTexture.h 2011-02-28 16:49:11 +0000
+++ src/IconTexture.h 2011-03-10 15:06:55 +0000
@@ -42,7 +42,8 @@
42protected:42protected:
43 const gchar* GetName ();43 const gchar* GetName ();
44 void AddProperties (GVariantBuilder *builder);44 void AddProperties (GVariantBuilder *builder);
4545 virtual bool DoCanFocus ();
46
46private:47private:
47 void Draw (nux::GraphicsEngine& GfxContext, bool force_draw);48 void Draw (nux::GraphicsEngine& GfxContext, bool force_draw);
4849
@@ -53,8 +54,6 @@
53 char *_icon_name;54 char *_icon_name;
54 unsigned int _size;55 unsigned int _size;
5556
56 virtual bool CanFocus ();
57
58 GdkPixbuf *_pixbuf_cached;57 GdkPixbuf *_pixbuf_cached;
59 nux::BaseTexture *_texture_cached;58 nux::BaseTexture *_texture_cached;
60 int _texture_width;59 int _texture_width;
6160
=== modified file 'src/PlacesGroup.cpp'
--- src/PlacesGroup.cpp 2011-03-07 10:40:56 +0000
+++ src/PlacesGroup.cpp 2011-03-10 15:06:55 +0000
@@ -58,7 +58,8 @@
58{58{
59 PlacesStyle *style = PlacesStyle::GetDefault ();59 PlacesStyle *style = PlacesStyle::GetDefault ();
60 nux::BaseTexture *arrow = style->GetGroupUnexpandIcon ();60 nux::BaseTexture *arrow = style->GetGroupUnexpandIcon ();
6161
62 _cached_name = NULL;
62 _group_layout = new nux::VLayout ("", NUX_TRACKER_LOCATION);63 _group_layout = new nux::VLayout ("", NUX_TRACKER_LOCATION);
6364
64 _header_layout = new nux::HLayout (NUX_TRACKER_LOCATION);65 _header_layout = new nux::HLayout (NUX_TRACKER_LOCATION);
@@ -77,11 +78,17 @@
77 _expand_label->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END);78 _expand_label->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END);
78 _expand_label->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT);79 _expand_label->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT);
79 _expand_label->SetTextColor (kExpandDefaultTextColor);80 _expand_label->SetTextColor (kExpandDefaultTextColor);
81 _expand_label->SetCanFocus (true);
82 _expand_label->FocusActivated.connect (sigc::mem_fun (this, &PlacesGroup::OnLabelActivated));
83 _expand_label->FocusChanged.connect (sigc::mem_fun (this, &PlacesGroup::OnLabelFocusChanged));
84
85
80 _header_layout->AddView (_expand_label, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);86 _header_layout->AddView (_expand_label, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
8187
82 _expand_icon = new nux::TextureArea ();88 _expand_icon = new nux::TextureArea ();
83 _expand_icon->SetTexture (arrow);89 _expand_icon->SetTexture (arrow);
84 _expand_icon->SetMinimumSize (arrow->GetWidth (), arrow->GetHeight ());90 _expand_icon->SetMinimumSize (arrow->GetWidth (), arrow->GetHeight ());
91 _expand_icon->SetCanFocus (false);
85 _header_layout->AddView (_expand_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);92 _header_layout->AddView (_expand_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
8693
87 SetLayout (_group_layout);94 SetLayout (_group_layout);
@@ -107,17 +114,39 @@
107}114}
108115
109void116void
117PlacesGroup::OnLabelActivated (nux::Area *label)
118{
119 SetExpanded (!_is_expanded);
120}
121
122void
123PlacesGroup::OnLabelFocusChanged (nux::Area *label)
124{
125 RefreshLabel ();
126}
127void
110PlacesGroup::SetName (const char *name)128PlacesGroup::SetName (const char *name)
111{129{
112 // Spaces are on purpose, want padding to be proportional to the size of the text130 // Spaces are on purpose, want padding to be proportional to the size of the text
113 // Bear with me, I'm trying something different :)131 // Bear with me, I'm trying something different :)
114 const gchar *temp = " <big>%s</big> ";132 const gchar *temp = " <big>%s</big> ";
115 gchar *tmp, *final;133 const gchar *temp_focused = " <big><b>%s</b></big> ";
134 gchar *tmp = NULL;
135 gchar *final = NULL;
136 if (_cached_name != NULL)
137 {
138 g_free (_cached_name);
139 }
140
141 _cached_name = g_strdup (name);
116142
117 tmp = g_markup_escape_text (name, -1);143 tmp = g_markup_escape_text (name, -1);
118144
119 final = g_strdup_printf (temp, tmp);145 if (_expand_label->GetFocused ())
120146 final = g_strdup_printf (temp_focused, tmp);
147 else
148 final = g_strdup_printf (temp, tmp);
149
121 _name->SetText (final);150 _name->SetText (final);
122151
123 g_free (tmp);152 g_free (tmp);
@@ -149,7 +178,7 @@
149}178}
150179
151void180void
152PlacesGroup::Refresh ()181PlacesGroup::RefreshLabel ()
153{182{
154 const char *temp = "<small>%s</small>";183 const char *temp = "<small>%s</small>";
155 char *result_string;184 char *result_string;
@@ -166,26 +195,38 @@
166 else195 else
167 {196 {
168 result_string = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,197 result_string = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
169 "See one more result",198 "See one more result",
170 "See %d more results",199 "See %d more results",
171 _n_total_items - _n_visible_items_in_unexpand_mode),200 _n_total_items - _n_visible_items_in_unexpand_mode),
172 _n_total_items - _n_visible_items_in_unexpand_mode);201 _n_total_items - _n_visible_items_in_unexpand_mode);
173 }202 }
174203
175 _expand_icon->SetVisible (!(_n_visible_items_in_unexpand_mode >= _n_total_items && _n_total_items != 0));204 _expand_icon->SetVisible (!(_n_visible_items_in_unexpand_mode >= _n_total_items && _n_total_items != 0));
176205
206 char *tmpname = g_strdup (_cached_name);
207 SetName (tmpname);
208 g_free (tmpname);
209
177 final = g_strdup_printf (temp, result_string);210 final = g_strdup_printf (temp, result_string);
178211
179 _expand_label->SetText (final);212 _expand_label->SetText (final);
180 _expand_label->SetVisible (_n_visible_items_in_unexpand_mode < _n_total_items);213 _expand_label->SetVisible (_n_visible_items_in_unexpand_mode < _n_total_items);
181214
215 QueueDraw ();
216
217 g_free ((result_string));
218 g_free (final);
219}
220
221void
222PlacesGroup::Refresh ()
223{
224 RefreshLabel ();
182 ComputeChildLayout ();225 ComputeChildLayout ();
183 QueueDraw ();226 QueueDraw ();
184
185 g_free ((result_string));
186 g_free (final);
187}227}
188228
229
189void230void
190PlacesGroup::Relayout ()231PlacesGroup::Relayout ()
191{232{
@@ -203,6 +244,12 @@
203 self->ComputeChildLayout ();244 self->ComputeChildLayout ();
204 self->_idle_id = 0;245 self->_idle_id = 0;
205246
247 if (self->GetFocused ())
248 {
249 self->SetFocused (false); // unset focus on all children
250 self->SetFocused (true); // set focus on first child
251 }
252
206 return FALSE;253 return FALSE;
207}254}
208255
209256
=== modified file 'src/PlacesGroup.h'
--- src/PlacesGroup.h 2011-03-06 17:40:56 +0000
+++ src/PlacesGroup.h 2011-03-10 15:06:55 +0000
@@ -65,6 +65,9 @@
65 void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags);65 void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
66 void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags);66 void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags);
67 void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags);67 void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags);
68 void OnLabelActivated (nux::Area *label);
69 void OnLabelFocusChanged (nux::Area *label);
70 void RefreshLabel ();
6871
69private:72private:
70 nux::VLayout *_group_layout;73 nux::VLayout *_group_layout;
@@ -81,6 +84,7 @@
81 bool _is_expanded;84 bool _is_expanded;
82 guint _n_visible_items_in_unexpand_mode;85 guint _n_visible_items_in_unexpand_mode;
83 guint _n_total_items;86 guint _n_total_items;
87 char *_cached_name;
84};88};
8589
86#endif90#endif
8791
=== modified file 'src/PlacesResultsView.cpp'
--- src/PlacesResultsView.cpp 2011-02-28 16:49:11 +0000
+++ src/PlacesResultsView.cpp 2011-03-10 15:06:55 +0000
@@ -41,6 +41,7 @@
4141
42 EnableVerticalScrollBar (true);42 EnableVerticalScrollBar (true);
43 EnableHorizontalScrollBar (false);43 EnableHorizontalScrollBar (false);
44 _idle_id = 0;
44}45}
4546
46PlacesResultsView::~PlacesResultsView ()47PlacesResultsView::~PlacesResultsView ()
@@ -55,8 +56,24 @@
55 ResetScrollToUp ();56 ResetScrollToUp ();
56 _groups.push_back (group);57 _groups.push_back (group);
57 _layout->AddView (group, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);58 _layout->AddView (group, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
59
60 if (_idle_id == 0)
61 _idle_id = g_idle_add ((GSourceFunc)OnIdleFocus, this);
58}62}
5963
64gboolean
65PlacesResultsView::OnIdleFocus (PlacesResultsView *self)
66{
67 self->_idle_id = 0;
68
69 if (self->GetFocused ())
70 {
71 self->SetFocused (false); // unset focus on all children
72 self->SetFocused (true); // set focus on first child
73 }
74
75 return FALSE;
76}
60void77void
61PlacesResultsView::RemoveGroup (PlacesGroup *group)78PlacesResultsView::RemoveGroup (PlacesGroup *group)
62{79{
@@ -64,6 +81,8 @@
64 ResetScrollToUp ();81 ResetScrollToUp ();
65 _groups.remove (group);82 _groups.remove (group);
66 _layout->RemoveChildObject (group);83 _layout->RemoveChildObject (group);
84 if (_idle_id == 0)
85 _idle_id = g_idle_add ((GSourceFunc)OnIdleFocus, this);
67}86}
6887
69void88void
7089
=== modified file 'src/PlacesResultsView.h'
--- src/PlacesResultsView.h 2011-02-28 10:08:19 +0000
+++ src/PlacesResultsView.h 2011-03-10 15:06:55 +0000
@@ -54,6 +54,8 @@
54private:54private:
55 nux::Layout *_layout;55 nux::Layout *_layout;
56 std::list<PlacesGroup *> _groups;56 std::list<PlacesGroup *> _groups;
57 uint _idle_id;
58 static gboolean OnIdleFocus (PlacesResultsView *self);
57};59};
5860
59#endif // PLACE_RESULTS_VIEW_H61#endif // PLACE_RESULTS_VIEW_H
6062
=== modified file 'src/PlacesSearchBar.cpp'
--- src/PlacesSearchBar.cpp 2011-03-08 18:01:39 +0000
+++ src/PlacesSearchBar.cpp 2011-03-10 15:06:55 +0000
@@ -65,15 +65,18 @@
65 _search_icon->SetMinMaxSize (icon->GetWidth (), icon->GetHeight ());65 _search_icon->SetMinMaxSize (icon->GetWidth (), icon->GetHeight ());
66 _layout->AddView (_search_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);66 _layout->AddView (_search_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
67 _search_icon->OnMouseClick.connect (sigc::mem_fun (this, &PlacesSearchBar::OnClearClicked));67 _search_icon->OnMouseClick.connect (sigc::mem_fun (this, &PlacesSearchBar::OnClearClicked));
68 _search_icon->SetCanFocus (false);
6869
69 _layered_layout = new nux::LayeredLayout ();70 _layered_layout = new nux::LayeredLayout ();
7071
71 _hint = new nux::StaticCairoText (" ");72 _hint = new nux::StaticCairoText (" ");
72 _hint->SetTextColor (nux::Color (1.0f, 1.0f, 1.0f, 0.5f));73 _hint->SetTextColor (nux::Color (1.0f, 1.0f, 1.0f, 0.5f));
74 _hint->SetCanFocus (false);
73 _layered_layout->AddLayer (_hint);75 _layered_layout->AddLayer (_hint);
7476
75 _pango_entry = new nux::TextEntry ("", NUX_TRACKER_LOCATION);77 _pango_entry = new nux::TextEntry ("", NUX_TRACKER_LOCATION);
76 _pango_entry->sigTextChanged.connect (sigc::mem_fun (this, &PlacesSearchBar::OnSearchChanged));78 _pango_entry->sigTextChanged.connect (sigc::mem_fun (this, &PlacesSearchBar::OnSearchChanged));
79 _pango_entry->SetCanFocus (true);
77 _pango_entry->activated.connect (sigc::mem_fun (this, &PlacesSearchBar::OnEntryActivated));80 _pango_entry->activated.connect (sigc::mem_fun (this, &PlacesSearchBar::OnEntryActivated));
78 _layered_layout->AddLayer (_pango_entry);81 _layered_layout->AddLayer (_pango_entry);
7982
@@ -87,6 +90,7 @@
87 _combo->SetVisible (false);90 _combo->SetVisible (false);
88 _combo->sigTriggered.connect (sigc::mem_fun (this, &PlacesSearchBar::OnComboChanged));91 _combo->sigTriggered.connect (sigc::mem_fun (this, &PlacesSearchBar::OnComboChanged));
89 _combo->GetMenuPage ()->sigMouseDownOutsideMenuCascade.connect (sigc::mem_fun (this, &PlacesSearchBar::OnMenuClosing));92 _combo->GetMenuPage ()->sigMouseDownOutsideMenuCascade.connect (sigc::mem_fun (this, &PlacesSearchBar::OnMenuClosing));
93 _combo->SetCanFocus (false); // NOT SUPPORTING THIS QUITE YET
90 _layout->AddView (_combo, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);94 _layout->AddView (_combo, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
9195
92 _layout->SetVerticalExternalMargin (18);96 _layout->SetVerticalExternalMargin (18);
@@ -119,12 +123,6 @@
119 return "";123 return "";
120}124}
121125
122bool
123PlacesSearchBar::CanFocus ()
124{
125 return false;
126}
127
128void PlacesSearchBar::AddProperties (GVariantBuilder *builder)126void PlacesSearchBar::AddProperties (GVariantBuilder *builder)
129{127{
130 nux::Geometry geo = GetGeometry ();128 nux::Geometry geo = GetGeometry ();
131129
=== modified file 'src/PlacesSearchBar.h'
--- src/PlacesSearchBar.h 2011-03-08 18:01:39 +0000
+++ src/PlacesSearchBar.h 2011-03-10 15:06:55 +0000
@@ -57,8 +57,6 @@
57 sigc::signal<void, const char *> search_changed;57 sigc::signal<void, const char *> search_changed;
58 sigc::signal<void> activated;58 sigc::signal<void> activated;
5959
60 bool CanFocus ();
61
62protected:60protected:
63 // Introspectable methods61 // Introspectable methods
64 const gchar * GetName ();62 const gchar * GetName ();
6563
=== modified file 'src/PlacesTile.cpp'
--- src/PlacesTile.cpp 2011-03-09 14:13:41 +0000
+++ src/PlacesTile.cpp 2011-03-10 15:06:55 +0000
@@ -41,6 +41,7 @@
41 OnMouseEnter.connect (sigc::mem_fun (this, &PlacesTile::RecvMouseEnter));41 OnMouseEnter.connect (sigc::mem_fun (this, &PlacesTile::RecvMouseEnter));
42 OnMouseLeave.connect (sigc::mem_fun (this, &PlacesTile::RecvMouseLeave));42 OnMouseLeave.connect (sigc::mem_fun (this, &PlacesTile::RecvMouseLeave));
43 FocusChanged.connect (sigc::mem_fun (this, &PlacesTile::OnFocusChanged));43 FocusChanged.connect (sigc::mem_fun (this, &PlacesTile::OnFocusChanged));
44 FocusActivated.connect (sigc::mem_fun (this, &PlacesTile::OnFocusActivated));
44 _can_pass_focus_to_composite_layout = false;45 _can_pass_focus_to_composite_layout = false;
45}46}
4647
@@ -349,3 +350,9 @@
349{350{
350 QueueDraw ();351 QueueDraw ();
351}352}
353
354void
355PlacesTile::OnFocusActivated (nux::Area *area)
356{
357 sigClick.emit (this);
358}
352359
=== modified file 'src/PlacesTile.h'
--- src/PlacesTile.h 2011-03-09 14:13:41 +0000
+++ src/PlacesTile.h 2011-03-10 15:06:55 +0000
@@ -40,7 +40,7 @@
4040
41protected:41protected:
42 virtual nux::Geometry GetHighlightGeometry ();42 virtual nux::Geometry GetHighlightGeometry ();
4343
44private:44private:
45 void Draw (nux::GraphicsEngine &GfxContext, bool force_draw);45 void Draw (nux::GraphicsEngine &GfxContext, bool force_draw);
46 void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw);46 void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw);
@@ -69,7 +69,7 @@
69 nux::TextureLayer *_hilight_layer;69 nux::TextureLayer *_hilight_layer;
7070
71 void OnFocusChanged (nux::Area *area);71 void OnFocusChanged (nux::Area *area);
7272 void OnFocusActivated (nux::Area *area);
73 int _last_width;73 int _last_width;
74 int _last_height;74 int _last_height;
7575
7676
=== modified file 'src/PlacesView.cpp'
--- src/PlacesView.cpp 2011-03-09 19:57:01 +0000
+++ src/PlacesView.cpp 2011-03-10 15:06:55 +0000
@@ -303,11 +303,13 @@
303 _group_added_conn = _entry->group_added.connect (sigc::mem_fun (this, &PlacesView::OnGroupAdded));303 _group_added_conn = _entry->group_added.connect (sigc::mem_fun (this, &PlacesView::OnGroupAdded));
304 _result_added_conn = _entry->result_added.connect (sigc::mem_fun (this, &PlacesView::OnResultAdded));304 _result_added_conn = _entry->result_added.connect (sigc::mem_fun (this, &PlacesView::OnResultAdded));
305 _result_removed_conn = _entry->result_removed.connect (sigc::mem_fun (this, &PlacesView::OnResultRemoved));305 _result_removed_conn = _entry->result_removed.connect (sigc::mem_fun (this, &PlacesView::OnResultRemoved));
306306
307 if (_entry == _home_entry && (g_strcmp0 (search_string, "") == 0))307 if (_entry == _home_entry && (g_strcmp0 (search_string, "") == 0))
308 _layered_layout->SetActiveLayer (_home_view);308 _layered_layout->SetActiveLayer (_home_view);
309 else309 else
310 _layered_layout->SetActiveLayer (_results_view);310 _layered_layout->SetActiveLayer (_results_view);
311
312
311}313}
312314
313PlaceEntry *315PlaceEntry *
@@ -605,6 +607,18 @@
605607
606 self->PlaceEntryActivateRequest (id, section, search_string);608 self->PlaceEntryActivateRequest (id, section, search_string);
607609
610 if (self->GetFocused ())
611 {
612 // reset the focus
613 self->SetFocused (false);
614 self->SetFocused (true);
615 }
616 else
617 {
618 // Not focused but we really should be
619 self->SetFocused (true);
620 }
621
608 g_free (id);622 g_free (id);
609 g_free (search_string);623 g_free (search_string);
610}624}
611625
=== modified file 'src/StaticCairoText.cpp'
--- src/StaticCairoText.cpp 2011-02-28 16:27:57 +0000
+++ src/StaticCairoText.cpp 2011-03-10 15:06:55 +0000
@@ -50,6 +50,7 @@
50 _ellipsize = NUX_ELLIPSIZE_END;50 _ellipsize = NUX_ELLIPSIZE_END;
51 _align = NUX_ALIGN_LEFT;51 _align = NUX_ALIGN_LEFT;
52 _fontstring = NULL;52 _fontstring = NULL;
53 SetCanFocus (false);
53}54}
5455
55StaticCairoText::~StaticCairoText ()56StaticCairoText::~StaticCairoText ()
@@ -477,9 +478,4 @@
477 self->sigFontChanged.emit (self);478 self->sigFontChanged.emit (self);
478}479}
479480
480bool StaticCairoText::CanFocus ()
481{
482 return false;
483}
484
485}481}
486482
=== modified file 'src/StaticCairoText.h'
--- src/StaticCairoText.h 2011-02-28 16:27:57 +0000
+++ src/StaticCairoText.h 2011-03-10 15:06:55 +0000
@@ -89,7 +89,6 @@
89 sigc::signal<void, StaticCairoText*> sigTextChanged;89 sigc::signal<void, StaticCairoText*> sigTextChanged;
90 sigc::signal<void, StaticCairoText*> sigTextColorChanged;90 sigc::signal<void, StaticCairoText*> sigTextColorChanged;
91 sigc::signal<void, StaticCairoText*> sigFontChanged;91 sigc::signal<void, StaticCairoText*> sigFontChanged;
92 virtual bool CanFocus ();
9392
94 private:93 private:
95 int _cached_extent_width;94 int _cached_extent_width;
9695
=== modified file 'tests/TestPlaces.cpp'
--- tests/TestPlaces.cpp 2011-02-28 23:17:14 +0000
+++ tests/TestPlaces.cpp 2011-03-10 15:06:55 +0000
@@ -46,6 +46,8 @@
46 _combo = new nux::ComboBoxSimple (NUX_TRACKER_LOCATION);46 _combo = new nux::ComboBoxSimple (NUX_TRACKER_LOCATION);
47 _combo->SetMinimumWidth (150);47 _combo->SetMinimumWidth (150);
48 _combo->sigTriggered.connect (sigc::mem_fun (this, &TestApp::OnComboChangedFoRealz));48 _combo->sigTriggered.connect (sigc::mem_fun (this, &TestApp::OnComboChangedFoRealz));
49 _combo->SetCanFocus (false);
50 g_debug ("can we focus? %s", _combo->CanFocus () ? "yes :(" : "no! :D");
49 layout->AddView (_combo, 0, nux::eCenter, nux::eFix);51 layout->AddView (_combo, 0, nux::eCenter, nux::eFix);
5052
51 _factory = PlaceFactory::GetDefault ();53 _factory = PlaceFactory::GetDefault ();