X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fdrag-drop-detector%2Fdrag-and-drop-detector-impl.cpp;h=d1ad5200c60f63472baf967f33837bb25d3d9027;hb=746ebfed348c504b732dcb3f55c92a39b5643414;hp=12d42fe01786f5d1d07d94a5c085e8f51d43ea29;hpb=edeb1cc73b32e5c1afb42a9fb63df0108d322cc3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp b/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp old mode 100644 new mode 100755 index 12d42fe..d1ad520 --- a/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp +++ b/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ void DragAndDropDetector::Attach(Dali::Toolkit::Control& control) } } mControls.push_back(control); - control.TouchSignal().Connect(this, &DragAndDropDetector::OnDrag); + control.TouchedSignal().Connect(this, &DragAndDropDetector::OnDrag); mFirstEnter.push_back(control.GetProperty< int >( Actor::Property::ID )); mPanGestureDetector.Attach(control); mPanGestureDetector.DetectedSignal().Connect(this, &DragAndDropDetector::OnPan); @@ -71,7 +71,7 @@ void DragAndDropDetector::Detach(Dali::Toolkit::Control& control) if(match != mControls.end()) { - match->TouchSignal().Disconnect(this, &DragAndDropDetector::OnDrag); + match->TouchedSignal().Disconnect(this, &DragAndDropDetector::OnDrag); mPanGestureDetector.Detach(*match); mFirstEnter.erase(std::find(mFirstEnter.begin(), mFirstEnter.end(), control.GetProperty< int >( Actor::Property::ID ))); mControls.erase(match); @@ -86,7 +86,7 @@ void DragAndDropDetector::DetachAll() auto iter = mControls.begin(); for(;iter != mControls.end();) { - iter->TouchSignal().Disconnect(this, &DragAndDropDetector::OnDrag); + iter->TouchedSignal().Disconnect(this, &DragAndDropDetector::OnDrag); mPanGestureDetector.Detach(*iter); iter = mControls.erase(iter); } @@ -123,9 +123,11 @@ void DragAndDropDetector::OnPan(Dali::Actor actor, const PanGesture& gesture) { Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor); - if(gesture.state == Gesture::Started) + GestureState state = gesture.GetState(); + + if(state == GestureState::STARTED) { - mDragLocalPosition = gesture.position; + mDragLocalPosition = gesture.GetPosition(); mPointDown = true; mDragControl = control; mFirstEnter.clear(); @@ -144,16 +146,16 @@ void DragAndDropDetector::OnPan(Dali::Actor actor, const PanGesture& gesture) mShadowControl.SetProperty( Actor::Property::PARENT_ORIGIN, control.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ) ); mShadowControl.SetProperty( Actor::Property::ANCHOR_POINT,control.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); control.GetParent().Add(mShadowControl); - SetPosition(gesture.screenPosition); + SetPosition(gesture.GetScreenPosition()); EmitStartedSignal(control); } - if(gesture.state == Gesture::Continuing) + if(state == GestureState::CONTINUING) { - Vector2 screenPosition = gesture.screenPosition; + Vector2 screenPosition = gesture.GetScreenPosition(); control.GetParent().ScreenToLocal(mLocalPosition.x, mLocalPosition.y, screenPosition.x, screenPosition.y); mShadowControl.SetProperty( Actor::Property::POSITION, Vector2(mLocalPosition.x - mDragLocalPosition.x, mLocalPosition.y - mDragLocalPosition.y)); } - if(gesture.state == Gesture::Finished) + if(state == GestureState::FINISHED) { mDragControl.GetParent().Remove(mShadowControl); EmitEndedSignal(control); @@ -209,7 +211,7 @@ bool DragAndDropDetector::OnDrag(Dali::Actor actor, const Dali::TouchEvent& data } mPointDown = false; } - return false; + return true; } const std::string& DragAndDropDetector::GetContent() const