mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 11:19:23 +02:00
Cocoa/ListView: ItemDelete() changed from asynchronous to synchronous #41124
because the selection has been changed to be loaded asynchronously after reloadData
This commit is contained in:
parent
7f4c1557a6
commit
d5ed1772b9
@ -151,7 +151,6 @@ type
|
|||||||
_collectionView: TCocoaCollectionView;
|
_collectionView: TCocoaCollectionView;
|
||||||
private
|
private
|
||||||
function getCallback: TLCLListViewCallback;
|
function getCallback: TLCLListViewCallback;
|
||||||
procedure doReloadDataAfterDelete( AIndex: PtrInt );
|
|
||||||
public
|
public
|
||||||
constructor Create( listView: TCocoaListView );
|
constructor Create( listView: TCocoaListView );
|
||||||
public
|
public
|
||||||
@ -1108,18 +1107,6 @@ end;
|
|||||||
procedure TCocoaWSListView_CollectionViewHandler.ItemDelete(
|
procedure TCocoaWSListView_CollectionViewHandler.ItemDelete(
|
||||||
const AIndex: Integer);
|
const AIndex: Integer);
|
||||||
begin
|
begin
|
||||||
Application.QueueAsyncCall( @doReloadDataAfterDelete, AIndex );
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCocoaWSListView_CollectionViewHandler.doReloadDataAfterDelete( AIndex: PtrInt );
|
|
||||||
var
|
|
||||||
lclcb : TLCLListViewCallback;
|
|
||||||
begin
|
|
||||||
lclcb:= getCallback;
|
|
||||||
if NOT Assigned(lclcb) then
|
|
||||||
Exit;
|
|
||||||
|
|
||||||
lclcb.selectionIndexSet.shiftIndexesStartingAtIndex_by( AIndex+1, -1 );
|
|
||||||
_collectionView.reloadData;
|
_collectionView.reloadData;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -191,7 +191,6 @@ type
|
|||||||
_tableView: TCocoaTableListView;
|
_tableView: TCocoaTableListView;
|
||||||
private
|
private
|
||||||
function getCallback: TLCLListViewCallback;
|
function getCallback: TLCLListViewCallback;
|
||||||
procedure doReloadDataAfterDelete( AIndex: PtrInt );
|
|
||||||
public
|
public
|
||||||
constructor Create( listView: TCocoaListView );
|
constructor Create( listView: TCocoaListView );
|
||||||
function getColumnFromIndex( const AIndex: Integer ): NSTableColumn;
|
function getColumnFromIndex( const AIndex: Integer ): NSTableColumn;
|
||||||
@ -1528,11 +1527,6 @@ begin
|
|||||||
Result:= TLCLListViewCallback( _tableView.lclGetCallback.GetCallbackObject );
|
Result:= TLCLListViewCallback( _tableView.lclGetCallback.GetCallbackObject );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCocoaWSListView_TableViewHandler.doReloadDataAfterDelete( AIndex: PtrInt);
|
|
||||||
begin
|
|
||||||
_tableView.lclDeleteItem( AIndex );
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCocoaWSListView_TableViewHandler.ColumnDelete(
|
procedure TCocoaWSListView_TableViewHandler.ColumnDelete(
|
||||||
const AIndex: Integer);
|
const AIndex: Integer);
|
||||||
var
|
var
|
||||||
@ -1714,7 +1708,7 @@ end;
|
|||||||
procedure TCocoaWSListView_TableViewHandler.ItemDelete(const AIndex: Integer
|
procedure TCocoaWSListView_TableViewHandler.ItemDelete(const AIndex: Integer
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
Application.QueueAsyncCall( @doReloadDataAfterDelete, AIndex );
|
_tableView.lclDeleteItem( AIndex );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCocoaWSListView_TableViewHandler.ItemDisplayRect(const AIndex,
|
function TCocoaWSListView_TableViewHandler.ItemDisplayRect(const AIndex,
|
||||||
|
Loading…
Reference in New Issue
Block a user