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