mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:59:25 +02:00
Cocoa/ListView: in vsReport, fix the issue RowHeight and Spacing related
This commit is contained in:
parent
c78b33853a
commit
16f03ef620
@ -895,23 +895,38 @@ procedure TCocoaWSListView_TableViewHandler.SetDefaultItemHeight(
|
|||||||
const AValue: Integer);
|
const AValue: Integer);
|
||||||
begin
|
begin
|
||||||
if AValue > 0 then
|
if AValue > 0 then
|
||||||
_tableView.setRowHeight(AValue);
|
_tableView.CustomRowHeight:= AValue;
|
||||||
// setRowSizeStyle could be used here but is available only in 10.7+
|
// setRowSizeStyle could be used here but is available only in 10.7+
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCocoaWSListView_TableViewHandler.SetImageList(
|
procedure TCocoaWSListView_TableViewHandler.SetImageList(
|
||||||
const AList: TListViewImageList; const AValue: TCustomImageListResolution);
|
const AList: TListViewImageList; const AValue: TCustomImageListResolution);
|
||||||
var
|
var
|
||||||
|
lclcb: TLCLListViewCallback;
|
||||||
|
lvil: TListViewImageList;
|
||||||
spacing: NSSize;
|
spacing: NSSize;
|
||||||
begin
|
begin
|
||||||
|
lclcb:= getCallback;
|
||||||
|
if NOT Assigned(lclcb) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
if NOT lclcb.GetImageListType(lvil) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
if AList <> lvil then
|
||||||
|
Exit;
|
||||||
|
|
||||||
_tableView.lclSetImagesInCell(Assigned(AValue));
|
_tableView.lclSetImagesInCell(Assigned(AValue));
|
||||||
|
|
||||||
if NOT Assigned(AValue) then
|
if NOT Assigned(AValue) then
|
||||||
Exit;
|
Exit;
|
||||||
if AValue.Height < _tableView.rowHeight-2 then
|
|
||||||
Exit;
|
|
||||||
spacing:= _tableView.intercellSpacing;
|
spacing:= _tableView.intercellSpacing;
|
||||||
spacing.height:= _tableView.rowHeight / 3 + 2;
|
spacing.height:= AValue.Height / 3 + 2;
|
||||||
|
if spacing.height < 6 then
|
||||||
|
spacing.height:= 6
|
||||||
|
else if spacing.height > 12 then
|
||||||
|
spacing.height:= 12;
|
||||||
_tableView.setIntercellSpacing( spacing );
|
_tableView.setIntercellSpacing( spacing );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user