void LinearLayout::SetCellPadding( LayoutSize size )
{
- mCellPadding = size;
+ if ( mCellPadding != size )
+ {
+ mCellPadding = size;
+ RequestLayout();
+ }
}
LayoutSize LinearLayout::GetCellPadding()
void LinearLayout::SetOrientation( Dali::Toolkit::LinearLayout::Orientation orientation )
{
- mOrientation = orientation;
+ if ( mOrientation != orientation )
+ {
+ mOrientation = orientation;
+ RequestLayout();
+ }
}
Dali::Toolkit::LinearLayout::Orientation LinearLayout::GetOrientation()
Extents padding = GetPadding();
- LayoutLength childTop( 0 );
+ LayoutLength childTop( padding.top );
LayoutLength childLeft( padding.start );
// Where bottom of child should go
{
Extents padding = GetPadding();
- LayoutLength childTop( 0 );
+ LayoutLength childTop( padding.top );
LayoutLength childLeft( padding.start );
// Where bottom of child should go
auto childMargin = childLayout->GetMargin();
childTop += childMargin.top;
- childLeft = ( childSpace - childWidth ) / 2 + (int)childMargin.start - (int)childMargin.end;
+ childLeft = LayoutLength( padding.start ) + ( childSpace - childWidth ) / 2 + childMargin.start - childMargin.end;
childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight );
childTop += childHeight + (int)childMargin.bottom + mCellPadding.height;