UPD: apply TDarwinImageUtil.getBestFromFileContentWithSize() in iCloudDrive

This commit is contained in:
rich2014 2026-01-24 08:13:27 +08:00
commit f7ca812c3c
2 changed files with 4 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

View file

@ -502,18 +502,13 @@ end;
procedure TiCloudDriveUIHandler.createImages;
var
tempImage: NSImage;
path: String;
begin
_downloadImage.release;
tempImage:= NSImage.alloc.initWithContentsOfFile( StrToNSString(mbExpandFileName(iCloudDriveConfig.icon.download)) );
tempImage.setSize( NSMakeSize(16,16) );
if TCocoaThemeServices.isDark then begin
_downloadImage:= TDarwinImageUtil.invertColor( tempImage );
end else begin
_downloadImage:= tempImage;
end;
path:= mbExpandFileName(iCloudDriveConfig.icon.download);
_downloadImage:= TDarwinImageUtil.getBestFromFileContentWithSize( path, 16, True );
_downloadImage.setSize( NSMakeSize(16,16) );
_downloadImage.retain;
tempImage.release;
end;
procedure TiCloudDriveUIHandler.releaseImages;