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=c7bbaf6988894d7f7823f4fd920e6ad1a2bff5bd;hp=3cd71d8420179e92b14ec334a9e9d8551e4a5761;hb=eea53605c5acb244aebb72d75bdd9b3a68a9678a;hpb=beacebbb139c15b44535e3d28c835fc31b412c7c diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index 3cd71d8..c7bbaf6 100755 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -25,22 +25,50 @@ #include #include #include +#include #include +#include #include -#include // INTERNAL INCLUDES #include -#include #include +#include +#include #include #include -#include using namespace Dali; +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal +{ + namespace { + +BaseHandle Create() +{ + return Toolkit::Popup::New(); +} + +// Setup properties, signals and actions using the type-registry. +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Popup, Toolkit::Control, Create ) + +DALI_SIGNAL_REGISTRATION( Popup, "touched-outside", SIGNAL_TOUCHED_OUTSIDE ) +DALI_SIGNAL_REGISTRATION( Popup, "hidden", SIGNAL_HIDDEN ) + +DALI_TYPE_REGISTRATION_END() + +// Properties +const char* const PROPERTY_TITLE = "title"; +const char* const PROPERTY_STATE = "state"; + const float CONTENT_DEPTH = 1.0f; ///< 3D Effect of buttons/title etc. appearing off the popup. const float POPUP_ANIMATION_DURATION = 0.5f; ///< Duration of hide/show animations const float BACKING_DEPTH = -1.0f; ///< Depth of backing (positioned just behind dialog, so dialog catches hit events first) @@ -53,16 +81,6 @@ const float POPUP_BUTTON_BG_HEIGHT = 96.f; ///< Height of But const Vector3 DEFAULT_DIALOG_SIZE = Vector3(POPUP_TITLE_WIDTH/POPUP_WIDTH, 0.5f, 0.0f); const Vector3 DEFAULT_BOTTOM_SIZE = Vector3(1.0f, 0.2f, 0.0f); -// Signals - -const char* const SIGNAL_TOUCHED_OUTSIDE = "touched-outside"; -const char* const SIGNAL_HIDDEN = "hidden"; - -// Properties - -const char* const PROPERTY_TITLE = "title"; -const char* const PROPERTY_STATE = "state"; - /** * The background size should be at least as big as the Dialog. * In some cases a background may have graphics which are visible @@ -99,32 +117,6 @@ Vector3 ButtonAreaSize( const Vector4& outBoarder, const Vector3& parentSize ) } // unnamed namespace -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -namespace -{ - -BaseHandle Create() -{ - return Toolkit::Popup::New(); -} - -TypeRegistration typeRegistration( typeid( Toolkit::Popup ), typeid( Toolkit::Control ), Create ); - -SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TOUCHED_OUTSIDE, &Popup::DoConnectSignal ); -SignalConnectorType signalConnector2( typeRegistration, SIGNAL_HIDDEN, &Popup::DoConnectSignal ); - - -} - - /////////////////////////////////////////////////////////////////////////////////////////////////// // Popup /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -488,13 +480,13 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration if(mShowing) { - mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); - mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::Scale), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) ); } else { - mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); - mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::Scale), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); + mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); } mAnimation.Play(); mAnimation.FinishedSignal().Connect(this, &Popup::OnStateAnimationFinished);