Cocoa/ListView: in vsIcon, item layout improved

This commit is contained in:
rich2014 2024-08-13 14:41:03 +08:00
parent 692a851975
commit 15feb49e17

View File

@ -351,8 +351,8 @@ begin
if cv.iconSize.Height < 32 then if cv.iconSize.Height < 32 then
cv.iconSize.Height:= 32; cv.iconSize.Height:= 32;
cv.itemSize.Width:= 10 + baseSize.Width + 10; cv.itemSize.Width:= 10 + cv.iconSize.Width + 10;
cv.itemSize.Height:= 10 + baseSize.Height + 2 + 14 + 10; cv.itemSize.Height:= 10 + cv.iconSize.Height + 2 + 14 + 10;
if cv.itemSize.Width < 64 then if cv.itemSize.Width < 64 then
cv.itemSize.Width:= 64; cv.itemSize.Width:= 64;
if cv.itemSize.Height < 68 then if cv.itemSize.Height < 68 then
@ -384,7 +384,7 @@ begin
aFrame.size.height:= 15; aFrame.size.height:= 15;
if Assigned(checkBox) then if Assigned(checkBox) then
aFrame.origin.x:= aFrame.origin.x + 24; aFrame.origin.x:= aFrame.origin.x + 24;
aFrame.size.width:= cv.itemSize.Width - aFrame.origin.x - 4; aFrame.size.width:= cv.itemSize.Width - aFrame.origin.x;
cocoaItem.textField.setAlignment( NSTextAlignmentCenter ); cocoaItem.textField.setAlignment( NSTextAlignmentCenter );
cocoaItem.textField.setFrame( aFrame ); cocoaItem.textField.setFrame( aFrame );
@ -401,7 +401,8 @@ procedure TCocoaListView_CollectionView_LargeIconHandler.onAdjustTextEditorRect(
var aFrame: NSRect); var aFrame: NSRect);
begin begin
aFrame.origin.y:= aFrame.origin.y - 1; aFrame.origin.y:= aFrame.origin.y - 1;
aFrame.size.width:= aFrame.size.width + 2; aFrame.origin.x:= aFrame.origin.x + 2;
aFrame.size.width:= aFrame.size.width - 4;
end; end;
{ TCocoaListView_CollectionView_SmallIconHandler } { TCocoaListView_CollectionView_SmallIconHandler }