mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-24 15:16:01 +02:00
IDE: mainbar: disable/enable auto sizing on auto height calculation.
git-svn-id: trunk@54358 -
This commit is contained in:
parent
f435e4865a
commit
ae7acd5803
@ -419,36 +419,42 @@ begin
|
||||
if not Showing then Exit;
|
||||
|
||||
//DebugLn(['TMainIDEBar.DoSetMainIDEHeight: IDEStarted=', LazarusIDE.IDEStarted]);
|
||||
if Assigned(IDEDockMaster) then
|
||||
begin
|
||||
if EnvironmentOptions.Desktop.AutoAdjustIDEHeight then
|
||||
|
||||
DisableAutoSizing;
|
||||
try
|
||||
if Assigned(IDEDockMaster) then
|
||||
begin
|
||||
if ANewHeight <= 0 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
|
||||
if EnvironmentOptions.Desktop.AutoAdjustIDEHeight then
|
||||
begin
|
||||
Constraints.MaxHeight := ANewHeight;
|
||||
Constraints.MinHeight := ANewHeight;
|
||||
ClientHeight := ANewHeight;
|
||||
end else if ClientHeight <> ANewHeight then
|
||||
ClientHeight := ANewHeight;
|
||||
if ANewHeight <= 0 then
|
||||
ANewHeight := CalcMainIDEHeight;
|
||||
IDEDockMaster.AdjustMainIDEWindowHeight(Self, True, ANewHeight)
|
||||
end
|
||||
else
|
||||
IDEDockMaster.AdjustMainIDEWindowHeight(Self, False, 0);
|
||||
end else
|
||||
if Constraints.MaxHeight <> 0 then
|
||||
begin
|
||||
Constraints.MaxHeight := 0;
|
||||
Constraints.MinHeight := 0;
|
||||
if (AIDEIsMaximized or EnvironmentOptions.Desktop.AutoAdjustIDEHeight) then
|
||||
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;
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user