X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpopup%2Fpopup-impl.cpp;h=94a0eade5434d43195974cf332cff6c01fc14ca3;hp=7d4c2e3d022ddba45f89659b1df9f763bd9a96ec;hb=f546dd5d83a968e573f8f053a01ce43df32c71a0;hpb=4593cc619ab0739fc8586c0c752209c555b0c8e3 diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index 7d4c2e3..94a0ead 100644 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,10 +39,10 @@ #include #include #include -#include #include #include #include +#include using namespace Dali; @@ -338,10 +338,17 @@ void Popup::OnInitialize() SetAsKeyboardFocusGroup( true ); SetupTouch(); + + DevelControl::SetAccessibilityConstructor( self, []( Dali::Actor actor ) { + return std::unique_ptr< Dali::Accessibility::Accessible >( + new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::DIALOG, true ) ); + } ); } Popup::~Popup() { + if( DevelControl::GetBoundAccessibilityObject( Self() ) ) + Accessibility::Bridge::GetCurrentBridge()->RemovePopup( DevelControl::GetBoundAccessibilityObject( Self() ) ); mEntryAnimationData.Clear(); mExitAnimationData.Clear(); } @@ -1532,7 +1539,7 @@ bool Popup::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra return connected; } -bool Popup::OnBackingTouched( Actor actor, const TouchData& touch ) +bool Popup::OnBackingTouched( Actor actor, const TouchEvent& touch ) { // Allow events to pass through if the backing isn't the hit-actor if( (touch.GetHitActor(0) == actor) && @@ -1559,18 +1566,27 @@ bool Popup::OnBackingWheelEvent( Actor actor, const WheelEvent& event ) return true; } -bool Popup::OnDialogTouched( Actor actor, const TouchData& touch ) +bool Popup::OnDialogTouched( Actor actor, const TouchEvent& touch ) { // Only connecting this so the backing does not become the default hit-actor and inadvertently closes the popup return false; } -void Popup::OnStageConnection( int depth ) +void Popup::OnSceneDisconnection() +{ + auto p = Dali::Accessibility::Accessible::Get(Self()); + Accessibility::Bridge::GetCurrentBridge()->RemovePopup( p ); + Control::OnSceneDisconnection(); +} + +void Popup::OnSceneConnection( int depth ) { mLayoutDirty = true; RelayoutRequest(); - Control::OnStageConnection( depth ); + Control::OnSceneConnection( depth ); + auto p = Dali::Accessibility::Accessible::Get(Self()); + Accessibility::Bridge::GetCurrentBridge()->AddPopup( p ); } void Popup::OnChildAdd( Actor& child ) @@ -1795,9 +1811,9 @@ bool Popup::OnKeyEvent( const KeyEvent& event ) bool consumed = false; - if( event.state == KeyEvent::Down ) + if( event.GetState() == KeyEvent::DOWN ) { - if (event.keyCode == Dali::DALI_KEY_ESCAPE || event.keyCode == Dali::DALI_KEY_BACK) + if (event.GetKeyCode() == Dali::DALI_KEY_ESCAPE || event.GetKeyCode() == Dali::DALI_KEY_BACK) { SetDisplayState( Toolkit::Popup::HIDDEN ); consumed = true; @@ -1963,17 +1979,17 @@ void Popup::SetupTouch() if( ! mTouchTransparent ) { // Connect all the signals and set us up to consume all touch events - mBacking.TouchSignal().Connect( this, &Popup::OnBackingTouched ); - mPopupBackgroundImage.TouchSignal().Connect( this, &Popup::OnDialogTouched ); - mPopupLayout.TouchSignal().Connect( this, &Popup::OnDialogTouched ); + mBacking.TouchedSignal().Connect( this, &Popup::OnBackingTouched ); + mPopupBackgroundImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched ); + mPopupLayout.TouchedSignal().Connect( this, &Popup::OnDialogTouched ); mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true ); } else { // We are touch transparent so disconnect all signals and ensure our layer does not consumed all touch events - mBacking.TouchSignal().Disconnect( this, &Popup::OnBackingTouched ); - mPopupBackgroundImage.TouchSignal().Disconnect( this, &Popup::OnDialogTouched ); - mPopupLayout.TouchSignal().Disconnect( this, &Popup::OnDialogTouched ); + mBacking.TouchedSignal().Disconnect( this, &Popup::OnBackingTouched ); + mPopupBackgroundImage.TouchedSignal().Disconnect( this, &Popup::OnDialogTouched ); + mPopupLayout.TouchedSignal().Disconnect( this, &Popup::OnDialogTouched ); mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, false ); } }