mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 04:49:40 +02:00
lcl: fix TButtonPanel.AutoSize
git-svn-id: trunk@19203 -
This commit is contained in:
parent
f7577be51b
commit
76a209955a
@ -73,6 +73,9 @@ type
|
||||
procedure UpdateButtonOrder;
|
||||
procedure UpdateSizes;
|
||||
protected
|
||||
procedure CalculatePreferredSize(
|
||||
var PreferredWidth, PreferredHeight: integer;
|
||||
WithThemeSpace: Boolean); override;
|
||||
function CreateControlBorderSpacing: TControlBorderSpacing; override;
|
||||
function CustomAlignInsertBefore(AControl1, AControl2: TControl): Boolean; override;
|
||||
procedure CustomAlignPosition(AControl: TControl; var ANewLeft, ANewTop, ANewWidth,
|
||||
@ -269,6 +272,19 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomButtonPanel.CalculatePreferredSize(var PreferredWidth,
|
||||
PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||
begin
|
||||
if HandleAllocated then
|
||||
begin
|
||||
if Align in [alTop, alBottom] then
|
||||
PreferredHeight := FButtonsHeight + Spacing + FBevel.Height
|
||||
else
|
||||
if Align in [alLeft, alRight] then
|
||||
PreferredWidth := FButtonsWidth + Spacing + FBevel.Width;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomButtonPanel.UpdateButtonOrder;
|
||||
const
|
||||
TabOrders: array[TButtonOrder, 0..3] of TPanelButton = (
|
||||
@ -478,7 +494,7 @@ begin
|
||||
alLeft: begin
|
||||
ANewTop := AlignRect.Top;
|
||||
ANewLeft := AlignRect.Left + FSpacing + FButtonsWidth;
|
||||
ANewHEight := AlignRect.Bottom - AlignRect.Top;
|
||||
ANewHeight := AlignRect.Bottom - AlignRect.Top;
|
||||
end;
|
||||
alRight: begin
|
||||
ANewTop := AlignRect.Top;
|
||||
|
Loading…
Reference in New Issue
Block a user