From b6dd78878f86ca83fa8cf803f290c5a275afaaaf Mon Sep 17 00:00:00 2001 From: dmitry Date: Thu, 13 Sep 2018 20:33:47 +0000 Subject: [PATCH] cocoa: update tab page view resizing for negative sizes git-svn-id: trunk@58974 - --- lcl/interfaces/cocoa/cocoatabcontrols.pas | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lcl/interfaces/cocoa/cocoatabcontrols.pas b/lcl/interfaces/cocoa/cocoatabcontrols.pas index d831257eee..2f2ff637c4 100644 --- a/lcl/interfaces/cocoa/cocoatabcontrols.pas +++ b/lcl/interfaces/cocoa/cocoatabcontrols.pas @@ -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;