Fixed: form position is not changed when no settings are available yet
This commit is contained in:
parent
396934b857
commit
8374bc2fee
@ -26,16 +26,19 @@ procedure ReadFormPos(const AFactory: TX2SettingsFactory;
|
|||||||
begin
|
begin
|
||||||
with AFactory[ASection] do
|
with AFactory[ASection] do
|
||||||
try
|
try
|
||||||
|
if ValueExists('Left') then
|
||||||
|
begin
|
||||||
if ReadBool('Maximized', (AForm.WindowState = wsMaximized)) then
|
if ReadBool('Maximized', (AForm.WindowState = wsMaximized)) then
|
||||||
AForm.WindowState := wsMaximized
|
AForm.WindowState := wsMaximized
|
||||||
else with THackCustomForm(AForm) do begin
|
else with THackCustomForm(AForm) do begin
|
||||||
WindowState := wsNormal;
|
WindowState := wsNormal;
|
||||||
Position := poDefaultPosOnly;
|
Position := poDesigned;
|
||||||
Left := ReadInteger('Left', Left);
|
Left := ReadInteger('Left', Left);
|
||||||
Top := ReadInteger('Top', Top);
|
Top := ReadInteger('Top', Top);
|
||||||
Width := ReadInteger('Width', Width);
|
Width := ReadInteger('Width', Width);
|
||||||
Height := ReadInteger('Height', Height);
|
Height := ReadInteger('Height', Height);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
finally
|
finally
|
||||||
Free();
|
Free();
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user