[gui] add TailLayout rowSize

This commit is contained in:
2019-03-05 16:38:34 +03:00
parent f1302e5636
commit 3f842f4cfc

View File

@@ -8,6 +8,8 @@ typedef Row = {
class TailLayout extends DefaultLayout {
public var rowSize:Int = 0;
// ToDo: check group.layoutAlign
private function placeRow(group:IGroupView, y:Float, row:Row):Void {
var x:Float = (group.width - row.width) / 2;
@@ -28,7 +30,10 @@ class TailLayout extends DefaultLayout {
for (view in views) {
setViewWidth(group, view);
setViewHeight(group, view);
if (row.width + view.width + margin + group.geometry.margin.horizontal > group.width) {
if (
(rowSize > 0 && row.views.length >= rowSize) ||
(row.width + view.width + margin + group.geometry.margin.horizontal > group.width)
) {
rows.push(row);
row = {
width: 0,