X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fitem-view%2Fitem-view-impl.cpp;h=939ab67053e95ac4fae7fee294d44d51f5d34de4;hp=43aa9a3b44b26f05283b80a7c7ca261d91ced58c;hb=be93fd772a1b1b09425ac0aaec1ea1b64e9a9e60;hpb=c01f2590ed7bb00d9b3600511d08dc420261ed46 diff --git a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp old mode 100755 new mode 100644 index 43aa9a3..939ab67 --- a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -25,15 +25,15 @@ #include #include -#include +#include #include -#include +#include #include #include #include // INTERNAL INCLUDES -#include +#include #include #include #include @@ -426,7 +426,7 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz Actor self = Self(); // The ItemView size should match the active layout size - self.SetSize(targetSize); + self.SetProperty( Actor::Property::SIZE, targetSize); mActiveLayoutTargetSize = targetSize; // Switch to the new layout @@ -446,7 +446,7 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz Vector3 size; mActiveLayout->GetItemSize( itemId, targetSize, size ); - actor.SetSize( size.GetVectorXY() ); + actor.SetProperty( Actor::Property::SIZE, size.GetVectorXY() ); } // Refresh the new layout @@ -972,7 +972,7 @@ void ItemView::SetupActor( Item item, const Vector3& layoutSize ) { Vector3 size; mActiveLayout->GetItemSize( item.first, mActiveLayoutTargetSize, size ); - item.second.SetSize( size.GetVectorXY() ); + item.second.SetProperty( Actor::Property::SIZE, size.GetVectorXY() ); mActiveLayout->ApplyConstraints( item.second, item.first, layoutSize, Self() ); } @@ -1029,7 +1029,7 @@ bool ItemView::OnWheelEvent(const WheelEvent& event) { Actor self = Self(); const Vector3 layoutSize = Self().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ); - float layoutPositionDelta = GetCurrentLayoutPosition(0) - (event.z * mWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor()); + float layoutPositionDelta = GetCurrentLayoutPosition(0) - (event.GetDelta() * mWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor()); float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout); self.SetProperty(Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition ); @@ -1114,7 +1114,7 @@ float ItemView::ClampFirstItemPosition( float targetPosition, const Vector3& tar return clamppedPosition; } -bool ItemView::OnTouch( Actor actor, const TouchData& touch ) +bool ItemView::OnTouch( Actor actor, const TouchEvent& touch ) { // Ignore events with multiple-touch points if (touch.GetPointCount() != 1) @@ -1142,7 +1142,7 @@ bool ItemView::OnTouch( Actor actor, const TouchData& touch ) RemoveAnimation(mScrollAnimation); } - return true; // consume since we're potentially scrolling + return false; // Do not consume as we're potentially scrolling (detecting pan gestures) } void ItemView::OnPan( const PanGesture& gesture ) @@ -1508,7 +1508,7 @@ Vector2 ItemView::GetCurrentScrollPosition() const void ItemView::AddOverlay(Actor actor) { - actor.SetDrawMode( DrawMode::OVERLAY_2D ); + actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); Self().Add(actor); } @@ -1575,7 +1575,7 @@ void ItemView::EnableScrollOvershoot( bool enable ) mOvershootOverlay.SetProperty( Actor::Property::COLOR,mOvershootEffectColor); mOvershootOverlay.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT ); mOvershootOverlay.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); - mOvershootOverlay.SetDrawMode( DrawMode::OVERLAY_2D ); + mOvershootOverlay.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); self.Add(mOvershootOverlay); ApplyOvershootSizeConstraint( mOvershootOverlay, mOvershootSize.height );