mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 13:19:18 +02:00
designer: improve look of non-visual components
git-svn-id: trunk@18805 -
This commit is contained in:
parent
dfc003e02b
commit
1fdf7aac12
@ -2466,7 +2466,7 @@ end;
|
|||||||
|
|
||||||
procedure TDesigner.DrawNonVisualComponents(aDDC: TDesignerDeviceContext);
|
procedure TDesigner.DrawNonVisualComponents(aDDC: TDesignerDeviceContext);
|
||||||
var
|
var
|
||||||
i, j, ItemLeft, ItemTop, ItemRight, ItemBottom: integer;
|
i, ItemLeft, ItemTop, ItemRight, ItemBottom: integer;
|
||||||
Diff, ItemLeftTop: TPoint;
|
Diff, ItemLeftTop: TPoint;
|
||||||
IconRect: TRect;
|
IconRect: TRect;
|
||||||
Icon: TBitmap;
|
Icon: TBitmap;
|
||||||
@ -2482,36 +2482,22 @@ begin
|
|||||||
// non-visual component
|
// non-visual component
|
||||||
ItemLeftTop := NonVisualComponentLeftTop(AComponent);
|
ItemLeftTop := NonVisualComponentLeftTop(AComponent);
|
||||||
ItemLeft := ItemLeftTop.X - Diff.X;
|
ItemLeft := ItemLeftTop.X - Diff.X;
|
||||||
ItemTop := ItemLeftTop.Y-Diff.Y;
|
ItemTop := ItemLeftTop.Y - Diff.Y;
|
||||||
ItemRight := ItemLeft+NonVisualCompWidth;
|
ItemRight := ItemLeft + NonVisualCompWidth;
|
||||||
ItemBottom := ItemTop+NonVisualCompWidth;
|
ItemBottom := ItemTop + NonVisualCompWidth;
|
||||||
if not aDDC.RectVisible(ItemLeft, ItemTop, ItemRight, ItemBottom) then
|
if not aDDC.RectVisible(ItemLeft, ItemTop, ItemRight, ItemBottom) then
|
||||||
Continue;
|
Continue;
|
||||||
aDDC.Save;
|
aDDC.Save;
|
||||||
with aDDC.Canvas do
|
with aDDC.Canvas do
|
||||||
begin
|
begin
|
||||||
Pen.Width := 1;
|
Pen.Width := 1;
|
||||||
Pen.Color := clWhite;
|
IconRect := Rect(ItemLeft, ItemTop, ItemRight, ItemBottom);
|
||||||
for j := 0 to NonVisualCompBorder - 1 do
|
Frame3D(IconRect, 1, bvRaised);
|
||||||
begin
|
|
||||||
MoveTo(ItemLeft + j, ItemBottom - j);
|
|
||||||
LineTo(ItemLeft + j, ItemTop + j);
|
|
||||||
LineTo(ItemRight - j, ItemTop + j);
|
|
||||||
end;
|
|
||||||
Pen.Color := clBlack;
|
|
||||||
for j := 0 to NonVisualCompBorder - 1 do
|
|
||||||
begin
|
|
||||||
MoveTo(ItemLeft + j, ItemBottom - j);
|
|
||||||
LineTo(ItemRight - j, ItemBottom - j);
|
|
||||||
MoveTo(ItemRight - j, ItemTop + j);
|
|
||||||
LineTo(ItemRight - j, ItemBottom - j + 1);
|
|
||||||
end;
|
|
||||||
IconRect := Rect(ItemLeft + NonVisualCompBorder, ItemTop + NonVisualCompBorder,
|
|
||||||
ItemRight - NonVisualCompBorder, ItemBottom - NonVisualCompBorder);
|
|
||||||
Brush.Color := clBtnFace;
|
Brush.Color := clBtnFace;
|
||||||
//writeln('TDesigner.DrawNonVisualComponents A ',IconRect.Left,',',IconRect.Top,',',IconRect.Right,',',IconRect.Bottom);
|
|
||||||
FillRect(Rect(IconRect.Left, IconRect.Top,
|
FillRect(Rect(IconRect.Left, IconRect.Top,
|
||||||
IconRect.Right + 1, IconRect.Bottom + 1));
|
IconRect.Right, IconRect.Bottom));
|
||||||
|
if NonVisualCompBorder > 1 then
|
||||||
|
InflateRect(IconRect, -NonVisualCompBorder + 1, - NonVisualCompBorder + 1);
|
||||||
end;
|
end;
|
||||||
if Assigned(FOnGetNonVisualCompIcon) then
|
if Assigned(FOnGetNonVisualCompIcon) then
|
||||||
begin
|
begin
|
||||||
|
@ -82,7 +82,7 @@ type
|
|||||||
const
|
const
|
||||||
NonVisualCompIconWidth = ComponentPaletteImageWidth;
|
NonVisualCompIconWidth = ComponentPaletteImageWidth;
|
||||||
NonVisualCompBorder = 2;
|
NonVisualCompBorder = 2;
|
||||||
NonVisualCompWidth = NonVisualCompIconWidth+2*NonVisualCompBorder;
|
NonVisualCompWidth = NonVisualCompIconWidth + 2 * NonVisualCompBorder;
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
|
Loading…
Reference in New Issue
Block a user