cocoa: update tab page view resizing for negative sizes

git-svn-id: trunk@58974 -
This commit is contained in:
dmitry 2018-09-13 20:33:47 +00:00
parent 7df6b50920
commit b6dd78878f

View File

@ -108,6 +108,7 @@ type
public
tabView: TCocoaTabControl;
tabPage: TCocoaTabPage;
procedure setFrame(arect: NSRect); override;
end;
function IndexOfTab(ahost: TCocoaTabControl; atab: NSTabViewItem): Integer;
@ -303,6 +304,20 @@ begin
end;
end;
{ TCocoaTabPageView }
procedure TCocoaTabPageView.setFrame(arect: NSRect);
begin
// It's possible for a tab page view to go in negative height.
// However, automatic resizing flags (for whatever reason) prevent
// TCocoaTabPageView to go into negative height (remaining at 0 pixels)
// The code below makes sure that resizing is actually happening
if Assigned(superView) and (superView.frame.size.height < arect.size.height) then
arect.size.height := superView.frame.size.height;
inherited setFrame(arect);
end;
{ TCocoaTabPage }
function TCocoaTabPage.lclGetCallback: ICommonCallback;