[view] add stretch param to TailLayout

This commit is contained in:
2020-02-19 20:52:25 +03:00
parent d217727d94
commit bc3d6e4458

View File

@@ -11,7 +11,8 @@ typedef Row = {
class TailLayout extends DefaultLayout {
public var rowSize:Int = 0;
@:style(0) public var rowSize:Null<Int>;
@:style(false) public var stretch:Null<Bool>;
private function placeRow(group:IGroupView, y:Float, row:Row):Void {
var x:Float = (group.width - row.width) / 2;
@@ -41,7 +42,7 @@ class TailLayout extends DefaultLayout {
setViewHeight(group, view);
if (
(rowSize > 0 && row.views.length >= rowSize) ||
(/*rowSize == 0 && */row.width + view.width + margin + group.geometry.margin.horizontal > size.width)
(/*rowSize == 0 && */row.width + view.width + margin + group.geometry.margin.horizontal > size.width && !stretch)
) {
row.width -= margin;
w = Math.max(w, row.width);