X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fmagnifier%2Fmagnifier-impl.cpp;h=aa1416a2ad00c6175b9b32003d37e10a3f84b979;hp=56806e8d6deba77322d360718bca49be0899f2a9;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=3eb60a0aef6b188727b79bdee2e35c575c432a90 diff --git a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp index 56806e8..aa1416a 100644 --- a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp +++ b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -21,9 +21,8 @@ // EXTERNAL INCLUDES #include #include -#include +#include #include -#include #include #include #include @@ -31,6 +30,9 @@ // INTERNAL INCLUDES #include #include +#include +#include +#include namespace Dali { @@ -146,6 +148,11 @@ Magnifier::Magnifier() mActorSize(Vector3::ZERO), mMagnificationFactor(1.0f) { + DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) { + return std::unique_ptr< Dali::Accessibility::Accessible >( + new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::FILLER ) ); + } ); + } void Magnifier::SetSourceActor(Actor actor) @@ -170,7 +177,7 @@ void Magnifier::Initialize() // and what is not. mSourceActor = Actor::New(); Stage().GetCurrent().Add(mSourceActor); - mSourceActor.SetParentOrigin(ParentOrigin::CENTER); + mSourceActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER ); Constraint constraint = Constraint::New( mSourceActor, Actor::Property::POSITION, EqualToConstraint() ); constraint.AddSource( Source( self, Toolkit::Magnifier::Property::SOURCE_POSITION ) ); constraint.Apply(); @@ -257,11 +264,11 @@ void Magnifier::SetFrameVisibility(bool visible) Actor self(Self()); mFrame = Actor::New( ); - mFrame.SetInheritPosition(false); - mFrame.SetInheritScale(true); + mFrame.SetProperty( Actor::Property::INHERIT_POSITION, false ); + mFrame.SetProperty( Actor::Property::INHERIT_SCALE, true ); mFrame.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f); - mFrame.SetSizeModeFactor( sizeOffset ); + mFrame.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeOffset ); Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get(); @@ -270,7 +277,7 @@ void Magnifier::SetFrameVisibility(bool visible) map[ Toolkit::BorderVisual::Property::COLOR ] = Color::WHITE; map[ Toolkit::BorderVisual::Property::SIZE ] = IMAGE_BORDER_INDENT; Toolkit::Visual::Base borderVisual = visualFactory.CreateVisual( map ); - borderVisual.SetOnStage( mFrame ); + Toolkit::GetImplementation(borderVisual).SetOnScene( mFrame ); Constraint constraint = Constraint::New( mFrame, Actor::Property::POSITION, EqualToConstraint() ); constraint.AddSource( ParentSource( Actor::Property::WORLD_POSITION ) ); @@ -286,8 +293,6 @@ void Magnifier::SetFrameVisibility(bool visible) void Magnifier::OnSizeSet(const Vector3& targetSize) { - Control::OnSizeSet( targetSize ); - // TODO: Once Camera/CameraActor properties function as proper animatable properties // this code can disappear. // whenever the size of the magnifier changes, the field of view needs to change @@ -295,6 +300,8 @@ void Magnifier::OnSizeSet(const Vector3& targetSize) // a constraint yet as Camera/CameraActor properties are not animatable/constrainable. mActorSize = targetSize; Update(); + + Control::OnSizeSet( targetSize ); } float Magnifier::GetMagnificationFactor() const @@ -315,7 +322,7 @@ void Magnifier::Update() // should be updated when: // Magnifier's world size/scale changes. Actor self(Self()); - Vector3 worldSize = mActorSize * self.GetCurrentWorldScale(); + Vector3 worldSize = mActorSize * self.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ); // Adjust field of view to scale content