IDE: open recent files: use load icon of new image list

git-svn-id: trunk@57165 -
This commit is contained in:
ondrej 2018-01-27 18:31:21 +00:00
parent 987f894152
commit f81b38e69d
2 changed files with 3 additions and 32 deletions

View File

@ -771,10 +771,8 @@ function LoadProjectIconIntoImages(const ProjFile: string;
var
xIconFile: String;
xIcon: TIcon;
I, xAlternativeIcon: Integer;
I: Integer;
xObj: TLoadProjectIconIntoImagesObject;
xScaledIcon: TCustomBitmap;
xNewIcon: Boolean;
begin
//ToDo: better index
@ -797,35 +795,7 @@ begin
xIcon := TIcon.Create;
try
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);
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;
Result := Images.AddIcon(xIcon);
finally
xIcon.Free;
end;

View File

@ -531,6 +531,7 @@ begin
DropdownMenu.Images := TCustomImageList.Create(Self);
DropdownMenu.Images.Width := Scale96ToScreen(16);
DropdownMenu.Images.Height := Scale96ToScreen(16);
DropdownMenu.Images.Scaled := False;
Style := tbsDropDown;
end;