Cocoa: dynamically set the spacing of TListView with icons

This commit is contained in:
rich2014 2024-01-26 21:53:21 +08:00
parent fa87c8a5bf
commit 6b6edf7857

View File

@ -1608,9 +1608,15 @@ class procedure TCocoaWSCustomListView.SetImageList(const ALV: TCustomListView;
var var
lCocoaLV: TCocoaListView; lCocoaLV: TCocoaListView;
lTableLV: TCocoaTableListView; lTableLV: TCocoaTableListView;
spacing: NSSize;
begin begin
if not CheckParams(lCocoaLV, lTableLV, ALV) then Exit; if not CheckParams(lCocoaLV, lTableLV, ALV) then Exit;
lTableLV.lclSetImagesInCell(Assigned(AValue)); lTableLV.lclSetImagesInCell(Assigned(AValue));
if AValue.Height < lTableLV.rowHeight-2 then Exit;
spacing:= lTableLV.intercellSpacing;
spacing.height:= lTableLV.rowHeight / 3 + 2;
lTableLV.setIntercellSpacing( spacing );
end; end;
class procedure TCocoaWSCustomListView.SetItemsCount( class procedure TCocoaWSCustomListView.SetItemsCount(