mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 15:16:21 +02:00
LCL: AutoSize=true, no childs, no content, consider AdjustClientRect
git-svn-id: trunk@24440 -
This commit is contained in:
parent
4df6b8b4c4
commit
c89fa706ff
@ -40,7 +40,7 @@ interface
|
||||
{$ENDIF}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, TypInfo, LCLStrConsts, LCLType, AvgLvlTree,
|
||||
Classes, SysUtils, TypInfo, types, LCLStrConsts, LCLType, AvgLvlTree,
|
||||
LCLProc, GraphType, Graphics, LMessages, LCLIntf, InterfaceBase, ImgList,
|
||||
UTrace, PropertyStorage, Menus, ActnList, LCLClasses, LResources;
|
||||
|
||||
|
@ -7780,10 +7780,11 @@ var
|
||||
Layout: TAutoSizeCtrlData;
|
||||
NewClientWidth: Integer;
|
||||
NewClientHeight: Integer;
|
||||
OldClientRect: TRect;
|
||||
CurClientRect: TRect;
|
||||
NewWidth: Integer;
|
||||
NewHeight: Integer;
|
||||
NewMoveLeft, NewMoveRight: integer;
|
||||
AdjustedClientRect: TRect;
|
||||
begin
|
||||
inherited CalculatePreferredSize(PreferredWidth,PreferredHeight,WithThemeSpace);
|
||||
|
||||
@ -7796,6 +7797,15 @@ begin
|
||||
inc(PreferredHeight,BorderSpacing.InnerBorder*2);
|
||||
end;
|
||||
|
||||
// check AdjustClientRect
|
||||
CurClientRect:=Rect(0,0,1000,1000);
|
||||
AdjustedClientRect:=CurClientRect;
|
||||
AdjustClientRect(AdjustedClientRect);
|
||||
PreferredWidth:=Max(PreferredWidth,
|
||||
AdjustedClientRect.Left+CurClientRect.Right-AdjustedClientRect.Right);
|
||||
PreferredHeight:=Max(PreferredHeight,
|
||||
AdjustedClientRect.Top+CurClientRect.Bottom-AdjustedClientRect.Bottom);
|
||||
|
||||
if ControlCount>0 then begin
|
||||
|
||||
// get the size requirements for the child controls
|
||||
@ -7810,10 +7820,9 @@ begin
|
||||
end;
|
||||
|
||||
// add the control border around the client area
|
||||
OldClientRect := GetClientRect;
|
||||
NewWidth:=Width-OldClientRect.Right+NewClientWidth;
|
||||
NewHeight:=Height-OldClientRect.Bottom+NewClientHeight;
|
||||
|
||||
CurClientRect := GetClientRect;
|
||||
NewWidth:=Width-CurClientRect.Right+NewClientWidth;
|
||||
NewHeight:=Height-CurClientRect.Bottom+NewClientHeight;
|
||||
{$IF defined(VerboseAutoSize) or defined(VerboseAllAutoSize)}
|
||||
debugln(['TWinControl.CalculatePreferredSize ',DbgSName(Self),
|
||||
' HandleAllocated=',HandleAllocated,
|
||||
|
Loading…
Reference in New Issue
Block a user