IDE: mainbar: disable/enable auto sizing on auto height calculation.

git-svn-id: trunk@54358 -
This commit is contained in:
ondrej 2017-03-07 10:58:04 +00:00
parent f435e4865a
commit ae7acd5803

View File

@ -419,36 +419,42 @@ begin
if not Showing then Exit; if not Showing then Exit;
//DebugLn(['TMainIDEBar.DoSetMainIDEHeight: IDEStarted=', LazarusIDE.IDEStarted]); //DebugLn(['TMainIDEBar.DoSetMainIDEHeight: IDEStarted=', LazarusIDE.IDEStarted]);
if Assigned(IDEDockMaster) then
begin DisableAutoSizing;
if EnvironmentOptions.Desktop.AutoAdjustIDEHeight then try
if Assigned(IDEDockMaster) then
begin begin
if ANewHeight <= 0 then if EnvironmentOptions.Desktop.AutoAdjustIDEHeight then
ANewHeight := CalcMainIDEHeight;
IDEDockMaster.AdjustMainIDEWindowHeight(Self, True, ANewHeight)
end
else
IDEDockMaster.AdjustMainIDEWindowHeight(Self, False, 0);
end else
begin
if (AIDEIsMaximized or EnvironmentOptions.Desktop.AutoAdjustIDEHeight) then
begin
if ANewHeight <= 0 then
ANewHeight := CalcMainIDEHeight;
Inc(ANewHeight, CalcNonClientHeight);
if ANewHeight <> Constraints.MaxHeight then
begin begin
Constraints.MaxHeight := ANewHeight; if ANewHeight <= 0 then
Constraints.MinHeight := ANewHeight; ANewHeight := CalcMainIDEHeight;
ClientHeight := ANewHeight; IDEDockMaster.AdjustMainIDEWindowHeight(Self, True, ANewHeight)
end else if ClientHeight <> ANewHeight then end
ClientHeight := ANewHeight; else
IDEDockMaster.AdjustMainIDEWindowHeight(Self, False, 0);
end else end else
if Constraints.MaxHeight <> 0 then
begin begin
Constraints.MaxHeight := 0; if (AIDEIsMaximized or EnvironmentOptions.Desktop.AutoAdjustIDEHeight) then
Constraints.MinHeight := 0; begin
if ANewHeight <= 0 then
ANewHeight := CalcMainIDEHeight;
Inc(ANewHeight, CalcNonClientHeight);
if ANewHeight <> Constraints.MaxHeight then
begin
Constraints.MaxHeight := ANewHeight;
Constraints.MinHeight := ANewHeight;
ClientHeight := ANewHeight;
end else if ClientHeight <> ANewHeight then
ClientHeight := ANewHeight;
end else
if Constraints.MaxHeight <> 0 then
begin
Constraints.MaxHeight := 0;
Constraints.MinHeight := 0;
end;
end; end;
finally
EnableAutoSizing;
end; end;
end; end;