|
@@ -288,7 +288,7 @@ begin
|
|
Size:=GetIntrinsicContentSize(flmMax,MaxWidth,MaxHeight);
|
|
Size:=GetIntrinsicContentSize(flmMax,MaxWidth,MaxHeight);
|
|
Node.ApplyScrollSize(Size);
|
|
Node.ApplyScrollSize(Size);
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
- writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" IntrinsicContentSize: Size=',FloatToCSSStr(Size.Width),'x',FloatToCSSStr(Size.Height),' ScrollSize=',FloatToCSSStr(Size.ScrollWidth),'x',FloatToCSSStr(Size.ScrollHeight),' NeedGutterHorz=',Size.NeedGutterHorizontal,' Vert=',Size.NeedGutterVertical,' Gutter:L=',FloatToCSSStr(Node.ScrollGutterLeft),',R=',FloatToCSSStr(Node.ScrollGutterRight),',T=',FloatToCSSStr(Node.ScrollGutterTop),',B=',FloatToCSSStr(Node.ScrollGutterBottom));
|
|
|
|
|
|
+ writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" IntrinsicContentSize: Size=',FloatToCSSStr(Size.Width),'x',FloatToCSSStr(Size.Height),' ScrollSize=',FloatToCSSStr(Size.OverflowWidth),'x',FloatToCSSStr(Size.OverflowHeight),' NeedGutterHorz=',Size.NeedGutterHorizontal,' Vert=',Size.NeedGutterVertical,' Gutter:L=',FloatToCSSStr(Node.ScrollGutterLeft),',R=',FloatToCSSStr(Node.ScrollGutterRight),',T=',FloatToCSSStr(Node.ScrollGutterTop),',B=',FloatToCSSStr(Node.ScrollGutterBottom));
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -311,7 +311,7 @@ begin
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
Size:=ComputeLayoutContent(flmMax,AvailWidth,AvailHeight,true);
|
|
Size:=ComputeLayoutContent(flmMax,AvailWidth,AvailHeight,true);
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
- writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" Size: ',FloatToCSSStr(Size.Width),'x',FloatToCSSStr(Size.Height),' Scroll: ',FloatToCSSStr(Size.ScrollWidth),'x',FloatToCSSStr(Size.ScrollWidth));
|
|
|
|
|
|
+ writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" Size: ',FloatToCSSStr(Size.Width),'x',FloatToCSSStr(Size.Height),' Scroll: ',FloatToCSSStr(Size.OverflowWidth),'x',FloatToCSSStr(Size.OverflowHeight));
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
if IsNan(Node.Width) then
|
|
if IsNan(Node.Width) then
|
|
begin
|
|
begin
|
|
@@ -500,7 +500,7 @@ var
|
|
|
|
|
|
var
|
|
var
|
|
GutterVertical, GutterHorizontal: TFresnelLayoutNode.TGutterMode;
|
|
GutterVertical, GutterHorizontal: TFresnelLayoutNode.TGutterMode;
|
|
- HasMaxWidth, HasMaxHeight, Done: Boolean;
|
|
|
|
|
|
+ HasMaxWidth, HasMaxHeight: Boolean;
|
|
aClientHeight, aClientWidth: TFresnelLength;
|
|
aClientHeight, aClientWidth: TFresnelLength;
|
|
|
|
|
|
procedure CheckOverflowX;
|
|
procedure CheckOverflowX;
|
|
@@ -515,8 +515,11 @@ var
|
|
Result.NeedGutterHorizontal:=true;
|
|
Result.NeedGutterHorizontal:=true;
|
|
GutterHorizontal:=gmAlways;
|
|
GutterHorizontal:=gmAlways;
|
|
Node.GetScrollGutterWidths(true,GutterTop,GutterBottom);
|
|
Node.GetScrollGutterWidths(true,GutterTop,GutterBottom);
|
|
- aClientHeight:=aClientHeight-GutterTop-GutterBottom;
|
|
|
|
- if aClientHeight<0 then aClientHeight:=0;
|
|
|
|
|
|
+ if HasMaxHeight then
|
|
|
|
+ begin
|
|
|
|
+ aClientHeight:=aClientHeight-GutterTop-GutterBottom;
|
|
|
|
+ if aClientHeight<0 then aClientHeight:=0;
|
|
|
|
+ end;
|
|
Result.Height:=Result.Height+GutterTop+GutterBottom;
|
|
Result.Height:=Result.Height+GutterTop+GutterBottom;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -534,8 +537,11 @@ var
|
|
Result.NeedGutterVertical:=true;
|
|
Result.NeedGutterVertical:=true;
|
|
GutterVertical:=gmAlways;
|
|
GutterVertical:=gmAlways;
|
|
Node.GetScrollGutterWidths(false,GutterLeft,GutterRight);
|
|
Node.GetScrollGutterWidths(false,GutterLeft,GutterRight);
|
|
- aClientWidth:=aClientWidth-GutterLeft-GutterRight;
|
|
|
|
- if aClientWidth<0 then aClientWidth:=0;
|
|
|
|
|
|
+ if HasMaxWidth then
|
|
|
|
+ begin
|
|
|
|
+ aClientWidth:=aClientWidth-GutterLeft-GutterRight;
|
|
|
|
+ if aClientWidth<0 then aClientWidth:=0;
|
|
|
|
+ end;
|
|
Result.Width:=Result.Width+GutterLeft+GutterRight;
|
|
Result.Width:=Result.Width+GutterLeft+GutterRight;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -566,7 +572,6 @@ begin
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
- Done:=false;
|
|
|
|
if aWithScroll then
|
|
if aWithScroll then
|
|
begin
|
|
begin
|
|
// consider gutters
|
|
// consider gutters
|
|
@@ -614,11 +619,8 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- Done:=true;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
- if not Done then
|
|
|
|
- begin
|
|
|
|
|
|
+ end else begin
|
|
|
|
+ // no gutters
|
|
Result:=ComputeLayoutContent(aMode,aMaxWidth,aMaxHeight,false);
|
|
Result:=ComputeLayoutContent(aMode,aMaxWidth,aMaxHeight,false);
|
|
//writeln('TFLNodeLayouter.GetIntrinsicContentSize ',Node.Element.Name,' ',aMode,' ',FloatToCSSStr(aMaxWidth),' ',FloatToCSSStr(aMaxHeight),' Computed=',Result.ToString);
|
|
//writeln('TFLNodeLayouter.GetIntrinsicContentSize ',Node.Element.Name,' ',aMode,' ',FloatToCSSStr(aMaxWidth),' ',FloatToCSSStr(aMaxHeight),' Computed=',Result.ToString);
|
|
end;
|
|
end;
|
|
@@ -2301,6 +2303,7 @@ var
|
|
i: Integer;
|
|
i: Integer;
|
|
Node: TUsedLayoutNode;
|
|
Node: TUsedLayoutNode;
|
|
ChildEl: TFresnelElement;
|
|
ChildEl: TFresnelElement;
|
|
|
|
+ Size: TFreIntrinsicContentSize;
|
|
begin
|
|
begin
|
|
Node:=TUsedLayoutNode(El.LayoutNode);
|
|
Node:=TUsedLayoutNode(El.LayoutNode);
|
|
if Node.SkipLayout then exit;
|
|
if Node.SkipLayout then exit;
|
|
@@ -2318,7 +2321,18 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
if Node.Layouter<>nil then
|
|
if Node.Layouter<>nil then
|
|
- Node.Layouter.Apply;
|
|
|
|
|
|
+ Node.Layouter.Apply
|
|
|
|
+ else begin
|
|
|
|
+ Size:=Node.GetIntrinsicContentSize(flmMax,Node.Width,Node.Height);
|
|
|
|
+ if Node.Width<Size.OverflowWidth then
|
|
|
|
+ Node.ScrollWidth:=Size.OverflowWidth
|
|
|
|
+ else
|
|
|
|
+ Node.ScrollWidth:=Node.Width;
|
|
|
|
+ if Node.Height<Size.OverflowHeight then
|
|
|
|
+ Node.ScrollHeight:=Size.OverflowHeight
|
|
|
|
+ else
|
|
|
|
+ Node.ScrollHeight:=Node.Height;
|
|
|
|
+ end;
|
|
|
|
|
|
for i:=0 to El.NodeCount-1 do
|
|
for i:=0 to El.NodeCount-1 do
|
|
Layout(El.Nodes[i]);
|
|
Layout(El.Nodes[i]);
|