UPD: new version Lazarus compatibility

(cherry picked from commit cf8a766615)
This commit is contained in:
rich2014 2026-03-09 19:56:04 +08:00 committed by Alexander Koblov
commit 061b8fbe1b
4 changed files with 9 additions and 9 deletions

View file

@ -82,7 +82,7 @@ begin
lclArray:= self.serviceMenuGetFilenames();
if lclArray=nil then exit;
cocoaArray:= StringArrayFromLCLToNS( lclArray );
cocoaArray:= TCocoaCollectionUtil.stringArrayToNSArray( lclArray );
pboard.declareTypes_owner( NSArray.arrayWithObject(NSFileNamesPboardType), nil );
pboard.setPropertyList_forType( cocoaArray, NSFileNamesPboardType );
Result:= true;

View file

@ -672,7 +672,7 @@ begin
sender,
edge );
NSControlMoveCaretToTheEnd( _tagsTokenField );
TCocoaControlUtil.moveCaretToTheEnd( _tagsTokenField );
self.tokenField_onUpdate;
end;
@ -879,7 +879,7 @@ class procedure TDarwinFinderUtil.popoverFileTagsEditor(
var
panel: TFinderTagsEditorPanel;
begin
panel:= TFinderTagsEditorPanel.editorWithPath( UrlArrayFromLCLToNS(paths) );
panel:= TFinderTagsEditorPanel.editorWithPath( TCocoaCollectionUtil.urlArrayToNSArray(paths) );
panel._onClose:= onClose;
panel.showPopover( positioningView, edge );
end;
@ -913,7 +913,7 @@ begin
200,
FINDER_FAVORITE_TAGS_MENU_ITEM_SIZE + FINDER_FAVORITE_TAGS_MENU_ITEM_SPACING*2 ) );
menuView.setLclMenu( lclMenu, lclMenu.Items[menuIndex+1] );
menuView.setUrls( UrlArrayFromLCLToNS(paths) );
menuView.setUrls( TCocoaCollectionUtil.urlArrayToNSArray(paths) );
menuView.setFavoriteTags( favoriteTags );
cocoaItem:= NSMenuItem( lclMenu.Items[menuIndex].Handle );

View file

@ -75,7 +75,7 @@ begin
if lclArray = nil then
Exit;
mate:= TQLPreviewPanelMate.alloc.initWithItems( UrlArrayFromLCLToNS(lclArray) );
mate:= TQLPreviewPanelMate.alloc.initWithItems( TCocoaCollectionUtil.urlArrayToNSArray(lclArray) );
panel:= QLPreviewPanel.sharedPreviewPanel;
panel.setDataSource( mate );
panel.makeKeyAndOrderFront( nil );
@ -98,7 +98,7 @@ type
constructor TFinderTagsEditorPanelHandler.Create( const paths: TStringArray );
begin
_urls:= UrlArrayFromLCLToNS( paths );
_urls:= TCocoaCollectionUtil.urlArrayToNSArray( paths );
_urls.retain;
_oldTagNames:= TDarwinFinderModelUtil.getTagNamesOfFiles( _urls );
_oldTagNames.retain;
@ -186,7 +186,7 @@ begin
if lclArray = nil then
Exit;
cocoaArray:= UrlArrayFromLCLToNS( lclArray );
cocoaArray:= TCocoaCollectionUtil.urlArrayToNSArray( lclArray );
control:= Screen.ActiveControl;
point:= control.ScreenToClient( Mouse.CursorPos );
@ -209,7 +209,7 @@ begin
if lclArray = nil then
Exit;
cocoaArray:= UrlArrayFromLCLToNS( lclArray );
cocoaArray:= TCocoaCollectionUtil.urlArrayToNSArray( lclArray );
service:= NSSharingService.sharingServiceNamed( NSSharingServiceNameSendViaAirDrop );
service.performWithItems( cocoaArray );
end;

View file

@ -557,7 +557,7 @@ var
if image = nil then
Exit;
destRect:= RectToNSRect( params.iconRect );
destRect:= TCocoaTypeUtil.toRect( params.iconRect );
destRect.origin.y:= destRect.origin.y + params.iconRect.Height/16;
destRect:= NSInsetRect( destRect, params.iconRect.Width/4, params.iconRect.Height/4 );