#include <dali/public-api/size-negotiation/relayout-container.h>
#include <dali/integration-api/debug.h>
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
-
using namespace Dali;
namespace
// currently not called from code so compiler will optimize these away, kept here for future debugging
#define FLEX_CONTAINER_TAG "DALI Toolkit::FlexContainer "
-#define FC_LOG(fmt, args...) Debug::LogMessage(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ## args)
+#define FC_LOG(fmt, args,...) Debug::LogMessage(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ## args)
// #define FLEX_CONTAINER_DEBUG 1
#if defined(FLEX_CONTAINER_DEBUG)
{ "center", Toolkit::FlexContainer::JUSTIFY_CENTER },
{ "flexEnd", Toolkit::FlexContainer::JUSTIFY_FLEX_END },
{ "spaceBetween", Toolkit::FlexContainer::JUSTIFY_SPACE_BETWEEN },
- { "spaceAround", Toolkit::FlexContainer::JUSTIFY_SPACE_AROUND }
+ { "spaceAround", Toolkit::FlexContainer::JUSTIFY_SPACE_AROUND },
+ { "spaceEvenly", Toolkit::FlexContainer::JUSTIFY_SPACE_EVENLY }
};
const unsigned int JUSTIFY_CONTENT_STRING_TABLE_COUNT = sizeof( JUSTIFY_CONTENT_STRING_TABLE ) / sizeof( JUSTIFY_CONTENT_STRING_TABLE[0] );
if( child )
{
// Anchor actor to top left of the container
- if( child.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >() )
+ if( child.GetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >() )
{
- child.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ child.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
}
- child.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ child.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
float negotiatedWidth = child.GetRelayoutSize(Dimension::WIDTH);
float negotiatedHeight = child.GetRelayoutSize(Dimension::HEIGHT);
Actor childActor = mChildrenNodes[i].actor.GetHandle();
// Intialize the style of the child.
- YGNodeStyleSetMinWidth( childNode, childActor.GetMinimumSize().x );
- YGNodeStyleSetMinHeight( childNode, childActor.GetMinimumSize().y );
- YGNodeStyleSetMaxWidth( childNode, childActor.GetMaximumSize().x );
- YGNodeStyleSetMaxHeight( childNode, childActor.GetMaximumSize().y );
+ YGNodeStyleSetMinWidth( childNode, childActor.GetProperty< Vector2 >( Actor::Property::MINIMUM_SIZE ).x );
+ YGNodeStyleSetMinHeight( childNode, childActor.GetProperty< Vector2 >( Actor::Property::MINIMUM_SIZE ).y );
+ YGNodeStyleSetMaxWidth( childNode, childActor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ).x );
+ YGNodeStyleSetMaxHeight( childNode, childActor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ).y );
// Check child properties on the child for how to layout it.
// These properties should be dynamically registered to the child which
#if defined(FLEX_CONTAINER_DEBUG)
YGNodePrint( mRootNode.node, (YGPrintOptions)( YGPrintOptionsLayout | YGPrintOptionsStyle | YGPrintOptionsChildren ) );
#endif
- YGNodeCalculateLayout( mRootNode.node, Self().GetMaximumSize().x, Self().GetMaximumSize().y, nodeLayoutDirection );
+ YGNodeCalculateLayout( mRootNode.node, Self().GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ).x, Self().GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ).y, nodeLayoutDirection );
#if defined(FLEX_CONTAINER_DEBUG)
YGNodePrint( mRootNode.node, (YGPrintOptions)( YGPrintOptionsLayout | YGPrintOptionsStyle | YGPrintOptionsChildren ) );
#endif
Dali::Actor child = mChildrenNodes[i].actor.GetHandle();
if( child )
{
- child.SetX( YGNodeLayoutGetLeft( mChildrenNodes[i].node ) );
- child.SetY( YGNodeLayoutGetTop( mChildrenNodes[i].node ) );
+ child.SetProperty( Actor::Property::POSITION_X, YGNodeLayoutGetLeft( mChildrenNodes[i].node ) );
+ child.SetProperty( Actor::Property::POSITION_Y, YGNodeLayoutGetTop( mChildrenNodes[i].node ) );
}
}
}
{
break;
}
- } while ( !mChildrenNodes[nextFocusedActorIndex].actor.GetHandle().IsKeyboardFocusable() );
+ } while ( !mChildrenNodes[nextFocusedActorIndex].actor.GetHandle().GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) );
break;
}
case Toolkit::Control::KeyboardFocus::RIGHT:
{
break;
}
- } while ( !mChildrenNodes[nextFocusedActorIndex].actor.GetHandle().IsKeyboardFocusable() );
+ } while ( !mChildrenNodes[nextFocusedActorIndex].actor.GetHandle().GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) );
break;
}
default:
mAlignContent( Toolkit::FlexContainer::ALIGN_FLEX_START )
{
SetKeyboardNavigationSupport( true );
- DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
- return std::unique_ptr< Dali::Accessibility::Accessible >(
- new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::FILLER ) );
- } );
}
void FlexContainer::OnInitialize()
YGNodeStyleSetAlignContent( mRootNode.node, static_cast<YGAlign>( mAlignContent ) );
// Make self as keyboard focusable and focus group
- self.SetKeyboardFocusable( true );
+ self.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
SetAsKeyboardFocusGroup( true );
}