From f81b38e69d1e45bf3e9206f28bf4b1042b3df13a Mon Sep 17 00:00:00 2001 From: ondrej Date: Sat, 27 Jan 2018 18:31:21 +0000 Subject: [PATCH] IDE: open recent files: use load icon of new image list git-svn-id: trunk@57165 - --- components/ideintf/projectintf.pas | 34 ++---------------------------- ide/mainbase.pas | 1 + 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/components/ideintf/projectintf.pas b/components/ideintf/projectintf.pas index 3e6fdf292f..18ea5cec1e 100644 --- a/components/ideintf/projectintf.pas +++ b/components/ideintf/projectintf.pas @@ -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; diff --git a/ide/mainbase.pas b/ide/mainbase.pas index 9412b1a2d4..b9a40a8769 100644 --- a/ide/mainbase.pas +++ b/ide/mainbase.pas @@ -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;