Favorites: High-DPI images, part 1

git-svn-id: trunk@58132 -
This commit is contained in:
ondrej 2018-06-05 07:43:28 +00:00
parent 8c5aa34fba
commit 04f1ea0b57

View File

@ -110,8 +110,6 @@ begin
end;
procedure TOpenFileFavToolButton.DoOnAdded;
var
xImg: TCustomBitmap;
begin
inherited DoOnAdded;
@ -123,21 +121,12 @@ begin
DropdownMenu := TPopupMenu.Create(Self);
if DropdownMenu.Images=nil then
begin
DropdownMenu.Images := TCustomImageList.Create(Self);
DropdownMenu.Images.Width := 16;
DropdownMenu.Images.Height := 16;
end;
DropdownMenu.Images := LCLGlyphs;
if DropdownMenu.Images<>LCLGlyphs then
raise Exception.Create('Favorites internal error 20180605093914');
xImg := TBitmap.Create;
try
IDEImages.Images_16.GetBitmap(IDEImages.LoadImage('laz_add'), xImg);
FAddImageIndex := DropdownMenu.Images.Add(xImg, nil);
IDEImages.Images_16.GetBitmap(IDEImages.LoadImage('laz_delete'), xImg);
FRemoveImageIndex := DropdownMenu.Images.Add(xImg, nil);
finally
xImg.Free;
end;
FAddImageIndex := LCLGlyphs.GetImageIndex('laz_add');
FRemoveImageIndex := LCLGlyphs.GetImageIndex('laz_delete');
FOrigOnPopup := DropdownMenu.OnPopup;
DropdownMenu.OnPopup := @RefreshMenu;