|
@@ -714,7 +714,7 @@ var
|
|
LNode: TUsedLayoutNode;
|
|
LNode: TUsedLayoutNode;
|
|
BarWidth, BarHeight: TFresnelLength;
|
|
BarWidth, BarHeight: TFresnelLength;
|
|
r, aPaddingBox: TFresnelRect;
|
|
r, aPaddingBox: TFresnelRect;
|
|
- aScrollbar: TRendererScrollBar;
|
|
|
|
|
|
+ HorzScrollbar, VertScrollbar: TRendererScrollBar;
|
|
IsLeft, HasVertBar, HasHorzBar: Boolean;
|
|
IsLeft, HasVertBar, HasHorzBar: Boolean;
|
|
VP: TFresnelViewport;
|
|
VP: TFresnelViewport;
|
|
begin
|
|
begin
|
|
@@ -741,7 +741,7 @@ begin
|
|
aPaddingBox:=El.GetUsedPaddingBox;
|
|
aPaddingBox:=El.GetUsedPaddingBox;
|
|
//writeln('TFresnelRenderer.DrawScrollBars ',El.Name,' PaddingBox=',aPaddingBox.ToString);
|
|
//writeln('TFresnelRenderer.DrawScrollBars ',El.Name,' PaddingBox=',aPaddingBox.ToString);
|
|
|
|
|
|
- aScrollbar:=TRendererScrollBar(El.ScrollBarVertical);
|
|
|
|
|
|
+ VertScrollbar:=TRendererScrollBar(El.ScrollBarVertical);
|
|
if HasVertBar then
|
|
if HasVertBar then
|
|
begin
|
|
begin
|
|
r:=aPaddingBox;
|
|
r:=aPaddingBox;
|
|
@@ -753,24 +753,24 @@ begin
|
|
r.Bottom:=Max(r.Top,r.Bottom-BarHeight);
|
|
r.Bottom:=Max(r.Top,r.Bottom-BarHeight);
|
|
|
|
|
|
if r.IsEmpty then
|
|
if r.IsEmpty then
|
|
- aScrollbar.Free
|
|
|
|
|
|
+ VertScrollbar.Free
|
|
else begin
|
|
else begin
|
|
- if aScrollbar=nil then
|
|
|
|
- aScrollbar:=CreateScrollBar(El,false);
|
|
|
|
- aScrollbar.Size:=LNode.ScrollHeight;
|
|
|
|
- aScrollbar.Page:=El.ClientHeight;
|
|
|
|
- aScrollbar.Position:=El.ScrollTop;
|
|
|
|
- aScrollbar.Box:=r;
|
|
|
|
- aScrollbar.HasColor:=El.GetComputedScrollbarColor(aScrollbar.ThumbColor,aScrollbar.TrackColor);
|
|
|
|
|
|
+ if VertScrollbar=nil then
|
|
|
|
+ VertScrollbar:=CreateScrollBar(El,false);
|
|
|
|
+ VertScrollbar.Size:=LNode.ScrollHeight;
|
|
|
|
+ VertScrollbar.Page:=El.ClientHeight;
|
|
|
|
+ VertScrollbar.Position:=El.ScrollTop;
|
|
|
|
+ VertScrollbar.Box:=r;
|
|
|
|
+ VertScrollbar.HasColor:=El.GetComputedScrollbarColor(VertScrollbar.ThumbColor,VertScrollbar.TrackColor);
|
|
|
|
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
writeln('TFresnelRenderer.DrawScrollBars ',El.Name,' Vertical ScrollHeight=',FloatToCSSStr(El.ScrollHeight),' ClientHeight=',FloatToCSSStr(El.ClientHeight),' ScrollTop=',FloatToCSSStr(El.ScrollTop)+' BarWidth='+FloatToCSSStr(BarWidth)+' r='+r.ToString);
|
|
writeln('TFresnelRenderer.DrawScrollBars ',El.Name,' Vertical ScrollHeight=',FloatToCSSStr(El.ScrollHeight),' ClientHeight=',FloatToCSSStr(El.ClientHeight),' ScrollTop=',FloatToCSSStr(El.ScrollTop)+' BarWidth='+FloatToCSSStr(BarWidth)+' r='+r.ToString);
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
end;
|
|
end;
|
|
- end else if aScrollbar<>nil then
|
|
|
|
- aScrollbar.Free;
|
|
|
|
|
|
+ end else if VertScrollbar<>nil then
|
|
|
|
+ VertScrollbar.Free;
|
|
|
|
|
|
- aScrollbar:=TRendererScrollBar(El.ScrollBarHorizontal);
|
|
|
|
|
|
+ HorzScrollbar:=TRendererScrollBar(El.ScrollBarHorizontal);
|
|
if HasHorzBar then
|
|
if HasHorzBar then
|
|
begin
|
|
begin
|
|
r:=aPaddingBox;
|
|
r:=aPaddingBox;
|
|
@@ -784,25 +784,24 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
if r.IsEmpty then
|
|
if r.IsEmpty then
|
|
- aScrollbar.Free
|
|
|
|
|
|
+ HorzScrollbar.Free
|
|
else begin
|
|
else begin
|
|
- if aScrollbar=nil then
|
|
|
|
- aScrollbar:=CreateScrollBar(El,true);
|
|
|
|
- aScrollbar.Size:=LNode.ScrollWidth;
|
|
|
|
- aScrollbar.Page:=El.ClientWidth;
|
|
|
|
|
|
+ if HorzScrollbar=nil then
|
|
|
|
+ HorzScrollbar:=CreateScrollBar(El,true);
|
|
|
|
+ HorzScrollbar.Size:=LNode.ScrollWidth;
|
|
|
|
+ HorzScrollbar.Page:=El.ClientWidth;
|
|
if El.ComputedDirection=CSSRegistry.kwRTL then
|
|
if El.ComputedDirection=CSSRegistry.kwRTL then
|
|
- aScrollbar.Position:=El.ScrollLeft+aScrollbar.Size-aScrollbar.Page
|
|
|
|
|
|
+ HorzScrollbar.Position:=El.ScrollLeft+HorzScrollbar.Size-HorzScrollbar.Page
|
|
else
|
|
else
|
|
- aScrollbar.Position:=El.ScrollLeft;
|
|
|
|
- aScrollbar.Box:=r;
|
|
|
|
- aScrollbar.HasColor:=El.GetComputedScrollbarColor(aScrollbar.ThumbColor,aScrollbar.TrackColor);
|
|
|
|
|
|
+ HorzScrollbar.Position:=El.ScrollLeft;
|
|
|
|
+ HorzScrollbar.Box:=r;
|
|
|
|
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
writeln('TFresnelRenderer.DrawScrollBars ',El.Name,' Horizontal ScrollWidth=',FloatToCSSStr(El.ScrollWidth),' ClientWidth=',FloatToCSSStr(El.ClientWidth),' ScrollLeft=',FloatToCSSStr(El.ScrollLeft)+' BarHeight='+FloatToCSSStr(BarHeight)+' r='+r.ToString);
|
|
writeln('TFresnelRenderer.DrawScrollBars ',El.Name,' Horizontal ScrollWidth=',FloatToCSSStr(El.ScrollWidth),' ClientWidth=',FloatToCSSStr(El.ClientWidth),' ScrollLeft=',FloatToCSSStr(El.ScrollLeft)+' BarHeight='+FloatToCSSStr(BarHeight)+' r='+r.ToString);
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
end;
|
|
end;
|
|
- end else if aScrollbar<>nil then
|
|
|
|
- aScrollbar.Free;
|
|
|
|
|
|
+ end else if HorzScrollbar<>nil then
|
|
|
|
+ HorzScrollbar.Free;
|
|
|
|
|
|
if HasVertBar or HasHorzBar then
|
|
if HasVertBar or HasHorzBar then
|
|
begin
|
|
begin
|
|
@@ -813,15 +812,21 @@ begin
|
|
and (VP.GetFirstPointerCaptureEl(El)=nil)
|
|
and (VP.GetFirstPointerCaptureEl(El)=nil)
|
|
then
|
|
then
|
|
exit;
|
|
exit;
|
|
- if HasHorzBar then
|
|
|
|
|
|
+ if HorzScrollbar<>nil then
|
|
begin
|
|
begin
|
|
- aScrollbar:=TRendererScrollBar(El.ScrollBarHorizontal);
|
|
|
|
- aScrollbar.Draw(Self);
|
|
|
|
|
|
+ HorzScrollbar.HasColor:=El.GetComputedScrollbarColor(HorzScrollbar.ThumbColor,HorzScrollbar.TrackColor);
|
|
|
|
+ HorzScrollbar.Draw(Self);
|
|
end;
|
|
end;
|
|
- if HasVertBar then
|
|
|
|
|
|
+ if VertScrollbar<>nil then
|
|
begin
|
|
begin
|
|
- aScrollbar:=TRendererScrollBar(El.ScrollBarVertical);
|
|
|
|
- aScrollbar.Draw(Self);
|
|
|
|
|
|
+ if HorzScrollbar<>nil then
|
|
|
|
+ begin
|
|
|
|
+ VertScrollbar.HasColor:=HorzScrollbar.HasColor;
|
|
|
|
+ VertScrollbar.ThumbColor:=HorzScrollbar.ThumbColor;
|
|
|
|
+ VertScrollbar.TrackColor:=HorzScrollbar.TrackColor;
|
|
|
|
+ end else
|
|
|
|
+ VertScrollbar.HasColor:=El.GetComputedScrollbarColor(VertScrollbar.ThumbColor,VertScrollbar.TrackColor);
|
|
|
|
+ VertScrollbar.Draw(Self);
|
|
end;
|
|
end;
|
|
if HasVertBar and HasHorzBar then
|
|
if HasVertBar and HasHorzBar then
|
|
begin
|
|
begin
|
|
@@ -836,7 +841,7 @@ begin
|
|
r.Left:=Max(aPaddingBox.Left,r.Right-BarWidth);
|
|
r.Left:=Max(aPaddingBox.Left,r.Right-BarWidth);
|
|
end;
|
|
end;
|
|
if not r.IsEmpty then
|
|
if not r.IsEmpty then
|
|
- aScrollbar.DrawCorner(Self,r);
|
|
|
|
|
|
+ HorzScrollbar.DrawCorner(Self,r);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|