mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 11:24:23 +01:00
cocoa: adding tabcontrols offset to match macOS layout rectangles. #32887
git-svn-id: trunk@58982 -
This commit is contained in:
parent
994600301f
commit
49c4dbe3c8
@ -71,6 +71,7 @@ type
|
||||
function lclGetCallback: ICommonCallback; override;
|
||||
procedure lclClearCallback; override;
|
||||
function lclClientFrame: TRect; override;
|
||||
function lclGetFrameToLayoutDelta: TRect; override;
|
||||
// NSTabViewDelegateProtocol
|
||||
function tabView_shouldSelectTabViewItem(tabView: NSTabView; tabViewItem: NSTabViewItem): Boolean; message 'tabView:shouldSelectTabViewItem:';
|
||||
procedure tabView_willSelectTabViewItem(tabView: NSTabView; tabViewItem: NSTabViewItem); message 'tabView:willSelectTabViewItem:';
|
||||
@ -423,11 +424,24 @@ begin
|
||||
end;
|
||||
|
||||
function TCocoaTabControl.lclClientFrame: TRect;
|
||||
var
|
||||
r : TRect;
|
||||
begin
|
||||
if isFlipped then
|
||||
Result:=NSRectToRect( contentRect )
|
||||
else
|
||||
NSToLCLRect( contentRect, frame.size.height, Result );
|
||||
|
||||
r:=lclGetFrameToLayoutDelta;
|
||||
Types.OffsetRect(Result, -r.Left, -r.Top);
|
||||
end;
|
||||
|
||||
function TCocoaTabControl.lclGetFrameToLayoutDelta: TRect;
|
||||
begin
|
||||
Result.Bottom := -10;
|
||||
Result.Top := 6;
|
||||
Result.Left := 7;
|
||||
Result.Right := -7;
|
||||
end;
|
||||
|
||||
function TCocoaTabControl.tabView_shouldSelectTabViewItem(tabView: NSTabView;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user