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.
This commit is contained in:
rich2014 2024-07-01 21:32:04 +08:00
parent 05e119e924
commit 9c955b7cf7

View File

@ -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;