mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 01:59:10 +02:00
lcl: fix TButtonPanel buttons height (it must be the same for all buttons)
git-svn-id: trunk@19576 -
This commit is contained in:
parent
9dc24780ac
commit
fb5ae56005
@ -250,25 +250,20 @@ end;
|
|||||||
procedure TCustomButtonPanel.UpdateSizes;
|
procedure TCustomButtonPanel.UpdateSizes;
|
||||||
var
|
var
|
||||||
btn: TPanelButton;
|
btn: TPanelButton;
|
||||||
|
BtnWidth, BtnHeight: Integer;
|
||||||
begin
|
begin
|
||||||
FButtonsHeight := 0;
|
if csDestroying in ComponentState then
|
||||||
|
Exit;
|
||||||
|
FButtonsHeight := DefMinHeight;
|
||||||
|
FButtonsWidth := DefMinWidth;
|
||||||
for btn := Low(btn) to High(btn) do
|
for btn := Low(btn) to High(btn) do
|
||||||
begin
|
begin
|
||||||
if FButtons[btn] = nil then Continue;
|
if FButtons[btn] = nil then Continue;
|
||||||
if FButtonsHeight > FButtons[btn].Height then Continue;
|
FButtons[btn].CalculatePreferredSize(BtnWidth, BtnHeight, True);
|
||||||
FButtonsHeight := FButtons[btn].Height;
|
if BtnWidth > FButtonsWidth then
|
||||||
end;
|
FButtonsWidth := BtnWidth;
|
||||||
|
if BtnHeight > FButtonsHeight then
|
||||||
if Align in [alLeft, alRight]
|
FButtonsHeight := BtnHeight;
|
||||||
then begin
|
|
||||||
// give the same width in this case too
|
|
||||||
FButtonsWidth := 0;
|
|
||||||
for btn := Low(btn) to High(btn) do
|
|
||||||
begin
|
|
||||||
if FButtons[btn] = nil then Continue;
|
|
||||||
if FButtonsWidth > FButtons[btn].Width then Continue;
|
|
||||||
FButtonsWidth := FButtons[btn].Width;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -291,6 +286,7 @@ begin
|
|||||||
if ShowBevel then
|
if ShowBevel then
|
||||||
inc(PreferredWidth, Spacing + FBevel.Width);
|
inc(PreferredWidth, Spacing + FBevel.Width);
|
||||||
end;
|
end;
|
||||||
|
ReAlign;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -409,8 +405,8 @@ begin
|
|||||||
Caption := '';
|
Caption := '';
|
||||||
ControlStyle := ControlStyle - [csSetCaption];
|
ControlStyle := ControlStyle - [csSetCaption];
|
||||||
AutoSize := True;
|
AutoSize := True;
|
||||||
FSpacing := 6;
|
FSpacing := 6;
|
||||||
ShowBevel := True;
|
ShowBevel := True;
|
||||||
|
|
||||||
|
|
||||||
FDefaultButton := pbOK;
|
FDefaultButton := pbOK;
|
||||||
@ -452,7 +448,6 @@ begin
|
|||||||
Name := NAMES[AButton];
|
Name := NAMES[AButton];
|
||||||
Parent := Self;
|
Parent := Self;
|
||||||
Kind := KINDS[AButton];
|
Kind := KINDS[AButton];
|
||||||
AutoSize := True;
|
|
||||||
Constraints.MinWidth := DefMinWidth;
|
Constraints.MinWidth := DefMinWidth;
|
||||||
Constraints.MinHeight := DefMinHeight;
|
Constraints.MinHeight := DefMinHeight;
|
||||||
Caption := GetCaption(AButton);
|
Caption := GetCaption(AButton);
|
||||||
|
Loading…
Reference in New Issue
Block a user