mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 19:00:27 +02:00
lcl: fix TPanel AdjustClientRect and Paint
git-svn-id: trunk@23919 -
This commit is contained in:
parent
114742d185
commit
2b7d5c5b63
@ -94,17 +94,16 @@ var
|
|||||||
TS : TTextStyle;
|
TS : TTextStyle;
|
||||||
begin
|
begin
|
||||||
ARect := GetClientRect;
|
ARect := GetClientRect;
|
||||||
|
|
||||||
// if BevelOuter is set then draw a frame with BevelWidth
|
// if BevelOuter is set then draw a frame with BevelWidth
|
||||||
if (BevelOuter <> bvNone) and (BevelWidth>0) then
|
if (BevelOuter <> bvNone) and (BevelWidth > 0) then
|
||||||
Canvas.Frame3d(ARect, BevelWidth, BevelOuter); // Note: Frame3D inflates ARect
|
Canvas.Frame3d(ARect, BevelWidth, BevelOuter); // Note: Frame3D inflates ARect
|
||||||
|
|
||||||
// if BevelInner is set then skip the BorderWidth and draw a frame with BevelWidth
|
|
||||||
if (BevelInner <> bvNone) and (BevelWidth>0) then
|
|
||||||
begin
|
|
||||||
if BorderWidth > 0 then
|
|
||||||
InflateRect(ARect, -BorderWidth, -BorderWidth);
|
InflateRect(ARect, -BorderWidth, -BorderWidth);
|
||||||
|
|
||||||
|
// if BevelInner is set then skip the BorderWidth and draw a frame with BevelWidth
|
||||||
|
if (BevelInner <> bvNone) and (BevelWidth > 0) then
|
||||||
Canvas.Frame3d(ARect, BevelWidth, BevelInner); // Note: Frame3D inflates ARect
|
Canvas.Frame3d(ARect, BevelWidth, BevelInner); // Note: Frame3D inflates ARect
|
||||||
end;
|
|
||||||
|
|
||||||
if Caption <> '' then
|
if Caption <> '' then
|
||||||
begin
|
begin
|
||||||
@ -136,18 +135,13 @@ var
|
|||||||
BevelSize: Integer;
|
BevelSize: Integer;
|
||||||
begin
|
begin
|
||||||
inherited AdjustClientRect(aRect);
|
inherited AdjustClientRect(aRect);
|
||||||
BevelSize:=0;
|
|
||||||
// if BevelOuter is set then draw a frame with BevelWidth
|
BevelSize := BorderWidth;
|
||||||
if (BevelOuter <> bvNone) and (BevelWidth > 0) then
|
if (BevelOuter <> bvNone) then
|
||||||
|
inc(BevelSize, BevelWidth);
|
||||||
|
if (BevelInner <> bvNone) then
|
||||||
inc(BevelSize, BevelWidth);
|
inc(BevelSize, BevelWidth);
|
||||||
|
|
||||||
// if BevelInner is set then skip the BorderWidth and draw a frame with BevelWidth
|
|
||||||
if (BevelInner <> bvNone) and (BevelWidth > 0) then
|
|
||||||
begin
|
|
||||||
if BorderWidth > 0 then
|
|
||||||
Inc(BevelSize, BorderWidth);
|
|
||||||
Inc(BevelSize, BevelWidth);
|
|
||||||
end;
|
|
||||||
InflateRect(aRect, -BevelSize, -BevelSize);
|
InflateRect(aRect, -BevelSize, -BevelSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user