mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 06:49:12 +02:00
Cocoa: Fix the issue that NSScrollView always consumes scrollWheel by itself
when NSScrollView itself does not need to scroll, scrollWheel should be passed to the upper NSScrollView. it's intuitive and consistent with usage habits. for example, the usability of "Lazarus IDE - Options Dialog" can be greatly improved.
This commit is contained in:
parent
5cb028ee29
commit
ed95006509
@ -53,6 +53,7 @@ type
|
||||
function lclClientFrame: TRect; override;
|
||||
function lclContentView: NSView; override;
|
||||
procedure setDocumentView(aView: NSView); override;
|
||||
procedure scrollWheel(theEvent: NSEvent); override;
|
||||
procedure ensureDocumentViewSizeChanged(newSize: NSSize;
|
||||
ensureWidth: Boolean; ensureHeight: Boolean);
|
||||
message 'ensureDocumentViewSizeChanged:newSize:ensureWidth:';
|
||||
@ -727,6 +728,16 @@ begin
|
||||
lclVertScrollInfo.fMask:= 0;
|
||||
end;
|
||||
|
||||
procedure TCocoaScrollView.scrollWheel(theEvent: NSEvent);
|
||||
begin
|
||||
if self.hasHorizontalScroller or self.hasVerticalScroller then
|
||||
inherited scrollWheel( theEvent )
|
||||
else if Assigned(self.enclosingScrollView) then
|
||||
self.enclosingScrollView.scrollWheel( theEvent )
|
||||
else
|
||||
inherited scrollWheel( theEvent );
|
||||
end;
|
||||
|
||||
procedure TCocoaScrollView.lclUpdate;
|
||||
begin
|
||||
documentView.lclUpdate;
|
||||
|
Loading…
Reference in New Issue
Block a user