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=ffd79e460a3aa9d5eee2ea087bb0546e7a8f6810;hp=441be0422d409c1d22597e36d56166ccfa99bcb7;hb=b458e407eba11c73f38da68bce8e967a30ea03e2;hpb=034a4b7aca01b9ba88a488d2aa5971367368865f diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index 441be04..ffd79e4 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 /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -509,13 +501,13 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration if(mShowing) { - mAnimation.AnimateTo( Property(mBacking, Actor::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); - mAnimation.AnimateTo( Property(mPopupBg, Actor::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::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) ); - mAnimation.AnimateTo( Property(mPopupBg, Actor::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);