LCL: TBitBtn: invalidate preferred size when changing layout so autosized buttons can resize correctly

git-svn-id: trunk@34507 -
This commit is contained in:
zeljko 2011-12-29 19:01:08 +00:00
parent 48b2cd29e5
commit 90d21bf0ea

View File

@ -143,8 +143,11 @@ procedure TCustomBitBtn.SetLayout(AValue: TButtonLayout);
begin
if FLayout = AValue then Exit;
FLayout := AValue;
if HandleAllocated
then TWSBitBtnClass(WidgetSetClass).SetLayout(Self, FLayout);
if HandleAllocated then
begin
TWSBitBtnClass(WidgetSetClass).SetLayout(Self, FLayout);
InvalidatePreferredSize;
end;
AdjustSize;
end;