mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 11:10:23 +02:00
Cocoa: Fix Document size in TCocoaScrollView
in the previous implementation, the entire frame of ScrollView was mistakenly used instead of Client Bound.
This commit is contained in:
parent
c00f60ad39
commit
ab4727c101
@ -1718,7 +1718,7 @@ begin
|
||||
begin
|
||||
sc:=TCocoaScrollView(obj);
|
||||
if sc.isCustomRange and (ScrollInfo.fMask and SIF_RANGE>0) then begin
|
||||
f:=sc.frame.size;
|
||||
f:=sc.contentSize;
|
||||
sz:=NSView(sc.documentView).frame.size; // type casting is here for the compiler. for i386 it messes up types
|
||||
flg:=sc.documentView.autoresizingMask;
|
||||
|
||||
|
@ -535,21 +535,25 @@ var
|
||||
docview: TCocoaCustomControl;
|
||||
lcl : TLCLCommonCallback;
|
||||
begin
|
||||
docview := TCocoaCustomControl.alloc.lclInitWithCreateParams(AParams);
|
||||
scrollcon:=EmbedInScrollView(docView);
|
||||
scrollcon:= TCocoaScrollView.alloc.lclInitWithCreateParams(AParams);
|
||||
ScrollViewSetBorderStyle(scrollcon, TScrollingWinControl(AWincontrol).BorderStyle);
|
||||
scrollcon.setDrawsBackground(false); // everything is covered anyway
|
||||
scrollcon.setBackgroundColor(NSColor.windowBackgroundColor);
|
||||
scrollcon.setAutohidesScrollers(True);
|
||||
scrollcon.setHasHorizontalScroller(True);
|
||||
scrollcon.setHasVerticalScroller(True);
|
||||
scrollcon.isCustomRange := true;
|
||||
|
||||
docview:= TCocoaCustomControl.alloc.init;
|
||||
docview.setFrameSize( scrollcon.contentSize );
|
||||
scrollcon.setDocumentView(docview);
|
||||
|
||||
lcl := TLCLCommonCallback.Create(docview, AWinControl, scrollcon);
|
||||
lcl.BlockCocoaUpDown := true;
|
||||
scrollcon.callback := lcl;
|
||||
docview.callback := lcl;
|
||||
docview.setAutoresizingMask(NSViewWidthSizable or NSViewHeightSizable);
|
||||
scrollcon.callback := lcl;
|
||||
scrollcon.setDocumentView(docview);
|
||||
ScrollViewSetBorderStyle(scrollcon, TScrollingWinControl(AWincontrol).BorderStyle);
|
||||
|
||||
Result := TLCLHandle(scrollcon);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user