Nux

Merge lp:~apinheiro/nux/Bug734803 into lp:nux

Proposed by Alejandro Piñeiro
Status: Merged
Merged at revision: 290
Proposed branch: lp:~apinheiro/nux/Bug734803
Merge into: lp:nux
Diff against target: 73 lines (+17/-0)
4 files modified
Nux/Layout.cpp (+4/-0)
Nux/Layout.h (+2/-0)
Nux/View.cpp (+8/-0)
Nux/View.h (+3/-0)
To merge this branch: bzr merge lp:~apinheiro/nux/Bug734803
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Jay Taoko Pending
Review via email: mp+54190@code.launchpad.net

Description of the change

See bug 734803 for more information

To post a comment you must log in.
lp:~apinheiro/nux/Bug734803 updated
289. By Jason Smith

merge hide cleanup branch

Revision history for this message
Neil J. Patel (njpatel) wrote :

Approved.

review: Approve
lp:~apinheiro/nux/Bug734803 updated
290. By Alejandro Piñeiro

Added child addition/removal signals on Layout and View

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/Layout.cpp'
2--- Nux/Layout.cpp 2011-03-17 15:01:12 +0000
3+++ Nux/Layout.cpp 2011-03-22 11:48:47 +0000
4@@ -90,6 +90,9 @@
5
6 if (it != _layout_element_list.end())
7 {
8+ /* we need to emit the signal before the unparent, just in case
9+ one of the callbacks wanted to use this object */
10+ ViewRemoved.emit (this, bo);
11 bo->UnParentObject();
12 _layout_element_list.erase (it);
13 }
14@@ -279,6 +282,7 @@
15 _layout_element_list.push_back (bo);
16 _connection_map[bo] = bo->ChildFocusChanged.connect (sigc::mem_fun (this, &Layout::OnChildFocusChanged));
17
18+ ViewAdded.emit (this, bo);
19 //--->> Removed because it cause problem with The splitter widget: ComputeLayout2();
20 }
21
22
23=== modified file 'Nux/Layout.h'
24--- Nux/Layout.h 2011-03-16 15:58:52 +0000
25+++ Nux/Layout.h 2011-03-22 11:48:47 +0000
26@@ -223,6 +223,8 @@
27
28 sigc::signal<void, Layout*> OnQueueDraw; //!< Signal emitted when a layout is scheduled for a draw.
29 sigc::signal<void, Area*> OnChildQueueDraw;
30+ sigc::signal<void, Layout*, Area*> ViewAdded;
31+ sigc::signal<void, Layout*, Area*> ViewRemoved;
32
33 virtual void DoSetFocused (bool focused);
34 virtual bool DoGetFocused ();
35
36=== modified file 'Nux/View.cpp'
37--- Nux/View.cpp 2011-03-17 15:01:27 +0000
38+++ Nux/View.cpp 2011-03-22 11:48:47 +0000
39@@ -386,6 +386,11 @@
40 m_CompositionLayout->SetFocused (false);
41
42 _on_focus_changed_handler.disconnect ();
43+
44+ /* we need to emit the signal before the unparent, just in case
45+ one of the callbacks wanted to use this object */
46+
47+ LayoutRemoved.emit (this, m_CompositionLayout);
48 m_CompositionLayout->UnParentObject();
49 }
50 layout->SetParentObject (this);
51@@ -396,6 +401,9 @@
52 layout->SetFocused (true);
53
54 _on_focus_changed_handler = layout->ChildFocusChanged.connect (sigc::mem_fun (this, &View::OnChildFocusChanged));
55+
56+ LayoutAdded.emit (this, m_CompositionLayout);
57+
58 return true;
59 }
60
61
62=== modified file 'Nux/View.h'
63--- Nux/View.h 2011-03-17 14:47:06 +0000
64+++ Nux/View.h 2011-03-22 11:48:47 +0000
65@@ -168,6 +168,9 @@
66 */
67 virtual bool SetLayout (Layout *layout);
68
69+ sigc::signal<void, View*, Layout*> LayoutAdded;
70+ sigc::signal<void, View*, Layout*> LayoutRemoved;
71+
72 void SetFont(ObjectPtr<FontTexture> font);
73 ObjectPtr<FontTexture> GetFont();
74

Subscribers

People subscribed via source and target branches