From 9c955b7cf7bc01925f4390f03748af591b2c0722 Mon Sep 17 00:00:00 2001 From: rich2014 Date: Mon, 1 Jul 2024 21:32:04 +0800 Subject: [PATCH] Grids: fix the issue that Grids don't update data to Cocoa when the ScrollBar is hidden on macOS on macOS, there are two styles: Legacy and Overlay. whether the ScrollBar data is synchronized can't be determined by whether it is visible. --- lcl/grids.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lcl/grids.pas b/lcl/grids.pas index ea8e1e04b4..2b5ef29e03 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -8149,7 +8149,9 @@ begin NeedUpdate := FHSbVisible <> Ord(AVisible); if NeedUpdate then ScrollBarShow(SB_HORZ, aVisible); + {$if NOT defined(DARWIN)} // on Cocoa, Overly Style ScrollBar always needs the latest data if aVisible or NeedUpdate then + {$endif} ScrollBarRange(SB_HORZ, aRange, aPage, aPos); end; @@ -8162,7 +8164,9 @@ begin {$endif} if FVSbVisible<>Ord(aVisible) then ScrollBarShow(SB_VERT, aVisible); + {$if NOT defined(DARWIN)} // on Cocoa, Overly Style ScrollBar always needs the latest data if aVisible then + {$endif} ScrollbarRange(SB_VERT, aRange, aPage, aPos ); end;