IDE: Minor cleanup in component palette options.

git-svn-id: trunk@46848 -
This commit is contained in:
juha 2014-11-14 10:56:40 +00:00
parent 6ddc19d342
commit dbf5bd53d4

View File

@ -500,20 +500,14 @@ var
Comp: TRegisteredComponent; Comp: TRegisteredComponent;
ARect: TRect; ARect: TRect;
CurIcon: TCustomBitmap; CurIcon: TCustomBitmap;
IconWidth, IconHeight: Integer;
begin begin
Comp := TRegisteredComponent(Item.Data); Comp := TRegisteredComponent(Item.Data);
ARect := Item.DisplayRect(drIcon); ARect := Item.DisplayRect(drIcon);
CurIcon := nil; if Comp is TPkgComponent then begin
if Comp is TPkgComponent then
CurIcon := TPkgComponent(Comp).Icon; CurIcon := TPkgComponent(Comp).Icon;
if CurIcon<>nil then if CurIcon<>nil then
begin Sender.Canvas.Draw(ARect.Left+(25-CurIcon.Width) div 2,
IconWidth := CurIcon.Width; ARect.Top+(ARect.Bottom-ARect.Top-CurIcon.Height) div 2, CurIcon);
IconHeight := CurIcon.Height;
Sender.Canvas.Draw(ARect.Left+(25-IconWidth) div 2,
ARect.Top+(ARect.Bottom-ARect.Top-IconHeight) div 2, CurIcon);
ARect.Left := ARect.Left + IconWidth + 2;
end; end;
end; end;