X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscrollable-impl.cpp;h=71e8be8c5518942b98750b28b9df425b288dfdd2;hb=2685b40c3f05eb62d648835a1b28814498436e2c;hp=d99e5e1da3efa908f96bdb6fd2147fa1675f3baa;hpb=e58fa784d19a558e35f458ecf6d262a2344beb4f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/base/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp index d99e5e1..71e8be8 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp @@ -1,18 +1,19 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // INTERNAL INCLUDES #include @@ -54,17 +55,20 @@ SignalConnectorType s4(mType, Toolkit::Scrollable::SIGNAL_SCROLL_CLAMPED, &Scr const std::string Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL( "scrollable-can-scroll-vertical" ); const std::string Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL( "scrollable-can-scroll-horizontal" ); +const Vector4 Scrollable::DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.6f); /////////////////////////////////////////////////////////////////////////////////////////////////// // Scrollable /////////////////////////////////////////////////////////////////////////////////////////////////// Scrollable::Scrollable() -: ControlImpl(true/*requires touch*/), +: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ), mPropertyRelativePosition(Property::INVALID_INDEX), mPropertyPositionMin(Property::INVALID_INDEX), mPropertyPositionMax(Property::INVALID_INDEX), mPropertyScrollDirection(Property::INVALID_INDEX), + mPropertyCanScrollVertical(Property::INVALID_INDEX), + mPropertyCanScrollHorizontal(Property::INVALID_INDEX), mOvershootEnabled(false) { } @@ -101,8 +105,11 @@ void Scrollable::EnableScrollComponent(Toolkit::Scrollable::ScrollComponentType { if(type == Toolkit::Scrollable::OvershootIndicator) { - SetOvershootEnabled(true); - mOvershootEnabled = true; + if( !mOvershootEnabled ) + { + SetOvershootEnabled(true); + mOvershootEnabled = true; + } return; } if( mComponents.find(type) == mComponents.end() ) @@ -121,8 +128,11 @@ void Scrollable::DisableScrollComponent(Toolkit::Scrollable::ScrollComponentType { if(type == Toolkit::Scrollable::OvershootIndicator) { - SetOvershootEnabled(false); - mOvershootEnabled = false; + if( mOvershootEnabled ) + { + SetOvershootEnabled(false); + mOvershootEnabled = false; + } return; } ComponentIter pair = mComponents.find( type );