Merge branch 'dockedformeditor/mainmenu' into 'main'

DockedFormEditor: FIX: wrong form height with MainMenu on Gtk2 (#38701 #40077)

See merge request freepascal.org/lazarus/lazarus!137
This commit is contained in:
Maxim Ganetsky 2023-04-23 23:50:24 +00:00
commit a4e781fce0

View File

@ -105,6 +105,7 @@ begin
+ Abs(FDesignForm.Form.Left) + Abs(FDesignForm.Form.Left)
+ FDesignForm.ClientOffset.X; + FDesignForm.ClientOffset.X;
LHeight := FDesignForm.Form.Height LHeight := FDesignForm.Form.Height
+ FakeMenu.Height
+ Abs(FDesignForm.Form.Top) + Abs(FDesignForm.Form.Top)
+ FDesignForm.ClientOffset.Y; + FDesignForm.ClientOffset.Y;
FormContainer.SetBounds(LLeft, LTop, LWidth, LHeight); FormContainer.SetBounds(LLeft, LTop, LWidth, LHeight);
@ -422,7 +423,7 @@ var
begin begin
if FDesignForm = nil then Exit; if FDesignForm = nil then Exit;
LWidth := FDesignForm.Width + 2 * SizerGripSize; LWidth := FDesignForm.Width + 2 * SizerGripSize;
LHeight := FDesignForm.Height + 2 * SizerGripSize; LHeight := FDesignForm.Height + 2 * SizerGripSize + FakeMenu.Height;
{$IFDEF DEBUGDOCKEDFORMEDITOR} DebugLn('TResizeControl.AdjustBounds: New ResizeControl Width:', DbgS(Width), ' Height: ', DbgS(Height)); {$ENDIF} {$IFDEF DEBUGDOCKEDFORMEDITOR} DebugLn('TResizeControl.AdjustBounds: New ResizeControl Width:', DbgS(Width), ' Height: ', DbgS(Height)); {$ENDIF}
FResizeContainer.SetBounds(-ScrollOffset.x, -ScrollOffset.y, LWidth, LHeight); FResizeContainer.SetBounds(-ScrollOffset.x, -ScrollOffset.y, LWidth, LHeight);
AdjustFormContainer; AdjustFormContainer;
@ -436,11 +437,11 @@ begin
if FormClient.Visible then if FormClient.Visible then
begin begin
FNewFormSize.X := FormClient.Width; FNewFormSize.X := FormClient.Width;
FNewFormSize.Y := FormClient.Height + FakeMenu.Height; FNewFormSize.Y := FormClient.Height;
end else if AnchorContainer.Visible then end else if AnchorContainer.Visible then
begin begin
FNewFormSize.X := AnchorContainer.Width; FNewFormSize.X := AnchorContainer.Width;
FNewFormSize.Y := AnchorContainer.Height + FakeMenu.Height; FNewFormSize.Y := AnchorContainer.Height;
end; end;
end; end;