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
auto height = bottom - top;
// Space available for child
- auto childSpace = height - padding.top - padding.bottom;
+ auto childSpace = height - (int)padding.top - (int)padding.bottom;
auto count = GetChildCount();
auto childHeight = childLayout->GetMeasuredHeight();
auto childMargin = childLayout->GetMargin();
- childTop = LayoutLength(padding.top) + ((childSpace - childHeight) / 2) + childMargin.top - childMargin.bottom;
+ childTop = LayoutLength(padding.top) + (int)((childSpace - childHeight) / 2) + (int)childMargin.top - (int)childMargin.bottom;
childLeft += childMargin.start;
childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight );
- childLeft += childWidth + childMargin.end + mCellPadding.width;
+ childLeft += childWidth + (int)childMargin.end + mCellPadding.width;
}
}
}
{
Extents padding = GetPadding();
- LayoutLength childTop( 0 );
+ LayoutLength childTop( padding.top );
LayoutLength childLeft( padding.start );
// Where bottom of child should go
auto width = right - left;
// Space available for child
- auto childSpace = width - padding.start - padding.end;
+ auto childSpace = width - (int)padding.start - (int)padding.end;
auto count = GetChildCount();
for( unsigned int childIndex = 0; childIndex < count; childIndex++)
auto childMargin = childLayout->GetMargin();
childTop += childMargin.top;
- childLeft = ( childSpace - childWidth ) / 2 + childMargin.start - childMargin.end;
+ childLeft = LayoutLength( padding.start ) + ( childSpace - childWidth ) / 2 + childMargin.start - childMargin.end;
childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight );
- childTop += childHeight + childMargin.bottom + mCellPadding.height;
+ childTop += childHeight + (int)childMargin.bottom + mCellPadding.height;
}
}
}