From: Paul Wisbey Date: Wed, 4 Mar 2015 19:35:12 +0000 (+0000) Subject: Only use 1 PanGestureDetector X-Git-Tag: new_text_0.1~19 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=582bba577c1c035d2e7f450f62117aa5821b8038;hp=297b1b9a9b6ed72fe98d5afb018ff4d1c951ce7d Only use 1 PanGestureDetector Change-Id: I6aca21345f52196ac516177b104b75437f3bdb7f --- diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 080967e..3603a6f 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -320,12 +320,9 @@ void TextField::OnInitialize() mController->EnableTextInput( mDecorator ); // Forward input events to controller - EnableGestureDetection( Gesture::Tap ); - - // TODO - Fix TapGestureDetector to support single and double tap mDoubleTapDetector = TapGestureDetector::New(); - mDoubleTapDetector.SetTapsRequired( 2 ); - mDoubleTapDetector.DetectedSignal().Connect( this, &TextField::OnDoubleTap ); + mDoubleTapDetector.SetMaximumTapsRequired( 2 ); + mDoubleTapDetector.DetectedSignal().Connect( this, &TextField::OnTap ); mDoubleTapDetector.Attach(Self()); // Set BoundingBox to stage size if not already set. @@ -372,14 +369,9 @@ void TextField::OnRelayout( const Vector2& size, ActorSizeContainer& container ) } } -void TextField::OnTap( const TapGesture& tap ) -{ - mController->TapEvent( tap.numberOfTaps, tap.localPoint.x, tap.localPoint.y ); -} - -void TextField::OnDoubleTap( Actor actor, const TapGesture& tap ) +void TextField::OnTap( Actor actor, const TapGesture& gesture ) { - mController->TapEvent( tap.numberOfTaps, tap.localPoint.x, tap.localPoint.y ); + mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y ); } void TextField::RequestTextRelayout() diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.h b/dali-toolkit/internal/controls/text-controls/text-field-impl.h index b6b11b1..0f6cf84 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -94,14 +94,9 @@ private: // From Control virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container ); /** - * @copydoc Control::OnTap() + * Received for single & double taps */ - virtual void OnTap( const TapGesture& tap ); - - /** - * TODO - Fix TapGestureDetector to support single and double tap - */ - void OnDoubleTap( Actor actor, const TapGesture& tap ); + void OnTap( Actor actor, const TapGesture& tap ); /** * @copydoc Text::ControlInterface::RequestTextRelayout()