Nux

Merge lp:~yeganeh/nux/fix-for-841864 into lp:nux

Proposed by Zaid Yeganeh
Status: Merged
Merged at revision: 496
Proposed branch: lp:~yeganeh/nux/fix-for-841864
Merge into: lp:nux
Diff against target: 80 lines (+21/-5)
3 files modified
Nux/AbstractButton.cpp (+9/-0)
Nux/View.cpp (+10/-5)
Nux/View.h (+2/-0)
To merge this branch: bzr merge lp:~yeganeh/nux/fix-for-841864
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+78315@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) wrote :

The interface for activate/de-activate has changed in Nux 2.0. I will port the change over.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/AbstractButton.cpp'
2--- Nux/AbstractButton.cpp 2011-09-20 06:03:43 +0000
3+++ Nux/AbstractButton.cpp 2011-10-05 21:24:25 +0000
4@@ -60,6 +60,9 @@
5
6 void AbstractButton::RecvClick(int x, int y, unsigned long button_flags, unsigned long key_flags)
7 {
8+ if (!IsViewActive())
9+ return;
10+
11 if(togglable_)
12 {
13 active = !active;
14@@ -80,6 +83,9 @@
15
16 void AbstractButton::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags)
17 {
18+ if (!IsViewActive())
19+ return;
20+
21 state = NUX_STATE_PRELIGHT;
22 //state = 1;
23 QueueDraw();
24@@ -87,6 +93,9 @@
25
26 void AbstractButton::RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
27 {
28+ if (!IsViewActive())
29+ return;
30+
31 state = NUX_STATE_ACTIVE;
32 QueueDraw();
33 }
34
35=== modified file 'Nux/View.cpp'
36--- Nux/View.cpp 2011-09-27 23:17:54 +0000
37+++ Nux/View.cpp 2011-10-05 21:24:25 +0000
38@@ -473,19 +473,24 @@
39
40 void View::ActivateView ()
41 {
42+ _is_view_active = true;
43+ }
44+
45+ void View::DeactivateView ()
46+ {
47 _is_view_active = false;
48 }
49
50- void View::DeactivateView ()
51- {
52- _is_view_active = true;
53- }
54-
55 bool View::IsViewActive () const
56 {
57 return _is_view_active;
58 }
59
60+ void View::SetViewActive (bool active)
61+ {
62+ _is_view_active = active;
63+ }
64+
65 void View::GeometryChangePending ()
66 {
67 QueueDraw ();
68
69=== modified file 'Nux/View.h'
70--- Nux/View.h 2011-09-20 06:03:43 +0000
71+++ Nux/View.h 2011-10-05 21:24:25 +0000
72@@ -113,6 +113,8 @@
73 */
74 bool IsViewActive () const;
75
76+ void SetViewActive (bool active);
77+
78 public:
79 virtual void ProcessDraw (GraphicsEngine &GfxContext, bool force_draw);
80 //! Causes a redraw. The widget parameter _need_redraw is set to true. The widget Draw(), DrawContent() and PostDraw() are called.

Subscribers

People subscribed via source and target branches