From: Adeel Kazmi Date: Mon, 29 Jun 2015 16:27:24 +0000 (-0700) Subject: Merge "Fix for selection handles." into devel/master X-Git-Tag: dali_1.0.47~8 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=5fa76665a97d14bf519ad0f41ad9f7bbacf81ec1;hp=3af09a190a90030049f6190ddd86522dc066c58a Merge "Fix for selection handles." into devel/master --- diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index 0eb1caf..cf450ef 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -903,7 +903,8 @@ struct Decorator::Impl : public ConnectionTracker mHandle[GRAB_HANDLE].actor.SetImage( imagePressed ); } } - else if( TouchPoint::Up == point.state ) + else if( ( TouchPoint::Up == point.state ) || + ( TouchPoint::Interrupted == point.state ) ) { mHandle[GRAB_HANDLE].pressed = false; Image imageReleased = mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED]; @@ -936,7 +937,8 @@ struct Decorator::Impl : public ConnectionTracker mHandle[LEFT_SELECTION_HANDLE].actor.SetImage( imagePressed ); } } - else if( TouchPoint::Up == point.state ) + else if( ( TouchPoint::Up == point.state ) || + ( TouchPoint::Interrupted == point.state ) ) { mHandle[LEFT_SELECTION_HANDLE].pressed = false; Image imageReleased = mHandleImages[flip ? RIGHT_SELECTION_HANDLE : LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED]; @@ -969,7 +971,8 @@ struct Decorator::Impl : public ConnectionTracker mHandle[RIGHT_SELECTION_HANDLE].actor.SetImage( imagePressed ); } } - else if( TouchPoint::Up == point.state ) + else if( ( TouchPoint::Up == point.state ) || + ( TouchPoint::Interrupted == point.state ) ) { Image imageReleased = mHandleImages[flip ? LEFT_SELECTION_HANDLE : RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED]; mHandle[RIGHT_SELECTION_HANDLE].pressed = false; @@ -1348,6 +1351,20 @@ float Decorator::GetCursorBlinkDuration() const void Decorator::SetHandleActive( HandleType handleType, bool active ) { mImpl->mHandle[handleType].active = active; + + if( !active ) + { + // TODO: this is a work-around. + // The problem is the handle actor does not receive the touch event with the Interrupt + // state when the power button is pressed and the application goes to background. + mImpl->mHandle[handleType].pressed = false; + Image imageReleased = mImpl->mHandleImages[handleType][HANDLE_IMAGE_RELEASED]; + ImageActor imageActor = mImpl->mHandle[handleType].actor; + if( imageReleased && imageActor ) + { + imageActor.SetImage( imageReleased ); + } + } } bool Decorator::IsHandleActive( HandleType handleType ) const