X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpopup%2Fpopup-impl.cpp;h=df6a1b2c2b31e6167b09309e5dd5a27254ae6160;hb=b26250b0bc810ebeada606481882102b62cdb3e4;hp=b9b9da77dc0e92f5cfe4fe627acc5fc5543901a6;hpb=2071317d301e9d5af326a3a2efcd2996263fbead;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index b9b9da7..df6a1b2 100755 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -35,9 +35,11 @@ // INTERNAL INCLUDES #include #include +#include #include -#include +#include #include +#include using namespace Dali; @@ -127,10 +129,10 @@ void Popup::OnInitialize() // Create Layer mLayer = Layer::New(); mLayer.SetName( "POPUP_LAYER" ); + mLayer.SetDepthTestDisabled( true ); mLayer.SetParentOrigin(ParentOrigin::CENTER); mLayer.SetAnchorPoint(AnchorPoint::CENTER); mLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mLayer.SetDrawMode( DrawMode::OVERLAY ); // Any content after this point which is added to Self() will be reparented to // mContent. @@ -222,6 +224,11 @@ void Popup::SetBackgroundImage( Actor image ) mBackgroundImage.SetAnchorPoint( AnchorPoint::CENTER ); mBackgroundImage.SetParentOrigin( ParentOrigin::CENTER ); + if ( ImageActor imageActor = DownCast< ImageActor >( image ) ) + { + imageActor.SetDepthIndex( BACKGROUND_DEPTH_INDEX ); + } + Vector3 border( mPopupStyle->backgroundOuterBorder.x, mPopupStyle->backgroundOuterBorder.z, 0.0f ); mBackgroundImage.SetSizeModeFactor( border ); @@ -242,6 +249,11 @@ void Popup::SetButtonAreaImage( Actor image ) // Adds new area image to the dialog. mButtonAreaImage = image; + if ( ImageActor imageActor = DownCast< ImageActor >( image ) ) + { + imageActor.SetDepthIndex( BACKGROUND_DEPTH_INDEX + 1 ); + } + // OnDialogTouched only consume the event. It prevents the touch event to be caught by the backing. mButtonAreaImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched ); @@ -415,14 +427,14 @@ void Popup::CreateBacking() { mBacking = Dali::Toolkit::CreateSolidColorActor( mPopupStyle->backingColor ); mBacking.SetName( "POPUP_BACKING" ); - + mBacking.SetDepthIndex( BACKGROUND_DEPTH_INDEX - 1 ); mBacking.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mBacking.SetSensitive(true); mLayer.Add( mBacking ); mBacking.SetOpacity(0.0f); mBacking.TouchedSignal().Connect( this, &Popup::OnBackingTouched ); - mBacking.MouseWheelEventSignal().Connect(this, &Popup::OnBackingMouseWheelEvent); + mBacking.WheelEventSignal().Connect(this, &Popup::OnBackingWheelEvent); } void Popup::CreateDialog() @@ -610,9 +622,9 @@ bool Popup::OnBackingTouched(Actor actor, const TouchEvent& event) return true; } -bool Popup::OnBackingMouseWheelEvent(Actor actor, const MouseWheelEvent& event) +bool Popup::OnBackingWheelEvent(Actor actor, const WheelEvent& event) { - // consume mouse wheel event in dimmed backing actor + // consume wheel event in dimmed backing actor return true; } @@ -675,8 +687,8 @@ void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container ) button.SetPosition( buttonPosition ); - button.PropagateRelayoutFlags(); // Reset relayout flags for relayout - container.Add( button, buttonSize ); + //Todo: Use the size negotiation pass instead of SetSize directly + button.SetSize( buttonSize ); } } } @@ -809,7 +821,7 @@ float Popup::GetWidthForHeight( float height ) return GetNaturalSize().width; } -Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled) +Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) { Actor nextFocusableActor( currentFocusedActor ); @@ -852,7 +864,7 @@ Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::C { switch ( direction ) { - case Toolkit::Control::Left: + case Toolkit::Control::KeyboardFocus::LEFT: { if ( iter == focusableActors.begin() ) { @@ -864,7 +876,7 @@ Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::C } break; } - case Toolkit::Control::Right: + case Toolkit::Control::KeyboardFocus::RIGHT: { if ( iter == focusableActors.end() - 1 ) { @@ -877,7 +889,7 @@ Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::C break; } - case Toolkit::Control::Up: + case Toolkit::Control::KeyboardFocus::UP: { if ( *iter == mContent ) { @@ -904,7 +916,7 @@ Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::C break; } - case Toolkit::Control::Down: + case Toolkit::Control::KeyboardFocus::DOWN: { if ( mContent && mContent.IsKeyboardFocusable() ) {