LCL: Take the width of TPageControl's TTabSheets into account in an autosized form. Issue #36493, patch by Joeny Ang.

git-svn-id: trunk@65218 -
This commit is contained in:
juha 2021-06-11 07:25:39 +00:00
parent 1159b4327b
commit a04f03d6df
2 changed files with 6 additions and 0 deletions

View File

@ -527,6 +527,7 @@ type
property PageControl: TPageControl read GetPageControl write SetPageControl; property PageControl: TPageControl read GetPageControl write SetPageControl;
property TabIndex: Integer read GetTabIndex; property TabIndex: Integer read GetTabIndex;
published published
property AutoSize;
property BorderWidth; property BorderWidth;
property BiDiMode; property BiDiMode;
property Caption; property Caption;
@ -606,6 +607,7 @@ type
property Align; property Align;
property Anchors; property Anchors;
property AutoSize;
property BorderSpacing; property BorderSpacing;
property BiDiMode; property BiDiMode;
property Constraints; property Constraints;

View File

@ -221,6 +221,10 @@ end;
function TCustomPage.IsControlVisible: Boolean; function TCustomPage.IsControlVisible: Boolean;
begin begin
// when autosizing, need this to return True so that the sizes of non-active
// pages will be considered in parent's GetPreferredSize()
if AutoSizingAll then
Exit(True);
Result := inherited IsControlVisible; Result := inherited IsControlVisible;
if Result and (Parent is TCustomTabControl) then if Result and (Parent is TCustomTabControl) then
Result := PageIndex = TCustomTabControl(Parent).PageIndex; Result := PageIndex = TCustomTabControl(Parent).PageIndex;