lcl gtk3: undo visible check, issue #38886

git-svn-id: trunk@65112 -
This commit is contained in:
mattias 2021-05-13 18:16:14 +00:00
parent 997274f7ee
commit 7b2e9d9bbd

View File

@ -2932,12 +2932,10 @@ procedure TGtk3Widget.SetBounds(ALeft,ATop,AWidth,AHeight:integer);
var
ARect: TGdkRectangle;
Alloc: TGtkAllocation;
AMinWidth, AMinHeight, ANaturalSize: gint;
AMinSize, ANaturalSize: gint;
begin
if (Widget=nil) then
exit;
if (not Widget^.get_visible) and (not Widget^.is_toplevel) then
exit;
if Self is TGtk3Button then
begin
@ -2945,26 +2943,25 @@ begin
dec(AHeight,4);
end;
ARect.x := ALeft;
ARect.y := ATop;
ARect.width := AWidth;
ARect.Height := AHeight;
with Alloc do
begin
x := ALeft;
y := ATop;
width := AWidth;
height := AHeight;
end;
BeginUpdate;
try
{fixes gtk3 assertion}
Widget^.get_preferred_width(@AMinWidth, @ANaturalSize);
Widget^.get_preferred_height(@AMinHeight, @ANaturalSize);
AWidth:=Max(AWidth,AMinWidth);
AHeight:=Max(AHeight,AMinHeight);
Widget^.set_size_request(AWidth,AHeight);
Widget^.get_preferred_width(@AMinSize, @ANaturalSize);
Widget^.get_preferred_height(@AMinSize, @ANaturalSize);
ARect.x := ALeft;
ARect.y := ATop;
ARect.width := AWidth;
ARect.Height := AHeight;
with Alloc do
begin
x := ALeft;
y := ATop;
width := AWidth;
height := AHeight;
end;
Widget^.set_size_request(AWidth,AHeight);
Widget^.size_allocate(@ARect);
Widget^.set_allocation(@Alloc);