mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-25 00:48:19 +02:00
IDE: open recent files: use load icon of new image list
git-svn-id: trunk@57165 -
This commit is contained in:
parent
987f894152
commit
f81b38e69d
@ -771,10 +771,8 @@ function LoadProjectIconIntoImages(const ProjFile: string;
|
|||||||
var
|
var
|
||||||
xIconFile: String;
|
xIconFile: String;
|
||||||
xIcon: TIcon;
|
xIcon: TIcon;
|
||||||
I, xAlternativeIcon: Integer;
|
I: Integer;
|
||||||
xObj: TLoadProjectIconIntoImagesObject;
|
xObj: TLoadProjectIconIntoImagesObject;
|
||||||
xScaledIcon: TCustomBitmap;
|
|
||||||
xNewIcon: Boolean;
|
|
||||||
begin
|
begin
|
||||||
//ToDo: better index
|
//ToDo: better index
|
||||||
|
|
||||||
@ -797,35 +795,7 @@ begin
|
|||||||
xIcon := TIcon.Create;
|
xIcon := TIcon.Create;
|
||||||
try
|
try
|
||||||
xIcon.LoadFromFile(xIconFile);
|
xIcon.LoadFromFile(xIconFile);
|
||||||
if xIcon.Count>0 then
|
|
||||||
xAlternativeIcon := 0
|
|
||||||
else
|
|
||||||
xAlternativeIcon := -1;
|
|
||||||
for I := 0 to xIcon.Count-1 do
|
|
||||||
begin
|
|
||||||
xIcon.Current := I;
|
|
||||||
if (xIcon.Width = Images.Width)
|
|
||||||
and(xIcon.Height = Images.Height) then
|
|
||||||
begin
|
|
||||||
Result := Images.AddIcon(xIcon);
|
Result := Images.AddIcon(xIcon);
|
||||||
Break;
|
|
||||||
end;
|
|
||||||
if (xIcon.Width = 16)
|
|
||||||
and(xIcon.Height = 16) then
|
|
||||||
xAlternativeIcon := I;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if (Result<0) and (xAlternativeIcon>=0) then
|
|
||||||
begin
|
|
||||||
xIcon.Current := xAlternativeIcon;
|
|
||||||
xScaledIcon := TIDEImages.ScaleImage(xIcon, xNewIcon, Images.Width, Images.Height, Images.Width/xIcon.Width);
|
|
||||||
try
|
|
||||||
Result := Images.Add(xScaledIcon, nil);
|
|
||||||
finally
|
|
||||||
if xNewIcon then
|
|
||||||
xScaledIcon.Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
finally
|
finally
|
||||||
xIcon.Free;
|
xIcon.Free;
|
||||||
end;
|
end;
|
||||||
|
@ -531,6 +531,7 @@ begin
|
|||||||
DropdownMenu.Images := TCustomImageList.Create(Self);
|
DropdownMenu.Images := TCustomImageList.Create(Self);
|
||||||
DropdownMenu.Images.Width := Scale96ToScreen(16);
|
DropdownMenu.Images.Width := Scale96ToScreen(16);
|
||||||
DropdownMenu.Images.Height := Scale96ToScreen(16);
|
DropdownMenu.Images.Height := Scale96ToScreen(16);
|
||||||
|
DropdownMenu.Images.Scaled := False;
|
||||||
Style := tbsDropDown;
|
Style := tbsDropDown;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user