X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Ftoggle-button-impl.cpp;h=e6c0ab7dfea1fbe5720dd9a8000c18a58fdad325;hb=1af7db409035af02e83b06805eddb16f774fb745;hp=ccc515ddf1f8d33b4819dc84ca8e6fa6a16958e0;hpb=d084a6dba7a3bf7c0db028359697934c85cc11a4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp b/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp index ccc515d..e6c0ab7 100755 --- a/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 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. @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include @@ -30,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -111,7 +109,7 @@ void ToggleButton::OnInitialize() // Toggle button requires the Leave event. Actor self = Self(); - self.SetLeaveRequired( true ); + self.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); } void ToggleButton::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value ) @@ -267,10 +265,10 @@ void ToggleButton::SetToggleStates( const Property::Array& states ) DALI_LOG_INFO( gLogButtonFilter, Debug::General, "ToggleButton::Began to register visual.\n" ); - PrepareVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] ); - PrepareVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] ); - PrepareVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] ); - PrepareVisual( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] ); RelayoutRequest(); } @@ -347,10 +345,10 @@ void ToggleButton::OnRelayout( const Vector2& size, RelayoutContainer& container { DALI_LOG_INFO( gLogButtonFilter, Debug::General, "ToggleButton::OnRelayout targetSize(%f,%f) ptr(%p)\n", size.width, size.height, this ); - RelayoutVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, size ); - RelayoutVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL, size ); - RelayoutVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, size ); - RelayoutVisual( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, size ); + RelayoutVisual( Toolkit::Button::Property::UNSELECTED_VISUAL, size ); + RelayoutVisual( Toolkit::Button::Property::SELECTED_VISUAL, size ); + RelayoutVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, size ); + RelayoutVisual( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, size ); } void ToggleButton::OnPressed() @@ -360,10 +358,10 @@ void ToggleButton::OnPressed() mCurrentToggleIndex = ( mCurrentToggleIndex + 1 ) % mToggleVisuals.size(); // Both create SelectedVisual and UnselectedVisual - PrepareVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] ); - PrepareVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] ); - PrepareVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] ); - PrepareVisual( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] ); + PrepareVisual( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] ); //Need to check mCurrentToggleIndex, it must less than the size of mToggleTooltips. if ( !mToggleTooltips.empty() && ( mCurrentToggleIndex < mToggleTooltips.size() ) )