diff --git a/lcl/interfaces/cocoa/cocoascrollers.pas b/lcl/interfaces/cocoa/cocoascrollers.pas index c2d5df715c..7644edf66c 100644 --- a/lcl/interfaces/cocoa/cocoascrollers.pas +++ b/lcl/interfaces/cocoa/cocoascrollers.pas @@ -180,13 +180,38 @@ var sz : Integer; dlt : double; v : double; +const + WinPageOfs : integer = 64; // this is an "ofset" of the pageInc used in Windows + // so the click on "large" makes two pages overlap begin Result := false; case prt of - NSScrollerDecrementPage: adj := -sc.largeInc; - NSScrollerIncrementPage: adj := sc.largeInc; - NSScrollerDecrementLine: adj := -sc.smallInc; - NSScrollerIncrementLine: adj := sc.smallInc; + NSScrollerDecrementPage: begin + adj := -sc.largeInc; + if adj = 0 then + begin + adj := -sc.pageInt; + if (sc.PageInt>WinPageOfs) then + inc(adj, WinPageOfs); + end; + end; + NSScrollerIncrementPage: begin + adj := sc.largeInc; + if adj = 0 then + begin + adj := sc.pageInt; + if (sc.PageInt>WinPageOfs) then + dec(adj, WinPageOfs); + end; + end; + NSScrollerDecrementLine: begin + adj := -sc.smallInc; + if adj = 0 then adj := -1; + end; + NSScrollerIncrementLine: begin + adj := sc.smallInc; + if adj = 0 then adj := 1; + end; else adj := 0; end;