@@ -19,7 +19,8 @@ TMain = class(TForm)
1919
2020var
2121 Main: TMain;
22- OldWidth, OldHeight: integer;
22+ WinOldWidth, WinOldHeight: integer;
23+ WinSaveSize: boolean;
2324
2425implementation
2526
@@ -29,11 +30,11 @@ procedure TMain.FormClose(Sender: TObject; var Action: TCloseAction);
2930var
3031 Ini: TIniFile;
3132begin
32- if (Main. WindowState <> wsMaximized) then
33- if (OldWidth <> Width) or (OldHeight <> Height) then begin
33+ if (WinSaveSize) and ( WindowState <> wsMaximized) then
34+ if (WinOldWidth <> Width) or (WinOldHeight <> Height) then begin
3435 Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0 )) + ' Config.ini' );
35- Ini.WriteInteger(' Main ' , ' Width' , Width);
36- Ini.WriteInteger(' Main ' , ' Height' , Height);
36+ Ini.WriteInteger(' Window ' , ' Width' , Width);
37+ Ini.WriteInteger(' Window ' , ' Height' , Height);
3738 Ini.Free;
3839 end ;
3940end ;
@@ -45,10 +46,7 @@ procedure TMain.FormCreate(Sender: TObject);
4546 EdgeBrowser.SetUserDataFolder(ExtractFilePath(ParamStr(0 )) + ' Data' );
4647
4748 Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0 )) + ' Config.ini' );
48- Width:=Ini.ReadInteger(' Main' , ' Width' , Width);
49- Height:=Ini.ReadInteger(' Main' , ' Height' , Height);
50- Main.Caption:=Ini.ReadString(' Main' , ' Caption' , ' ' );
51-
49+ Main.Caption:=Ini.ReadString(' Main' , ' Title' , ' ' );
5250 LocalFile:=Ini.ReadString(' Main' , ' File' , ' ' );
5351 LocalFile:=StringReplace(LocalFile, ' %FULLPATH%/' , ExtractFilePath(ParamStr(0 )), []);
5452 LocalFile:=StringReplace(LocalFile, ' \' , ' /' , [rfReplaceAll]);
@@ -60,9 +58,33 @@ procedure TMain.FormCreate(Sender: TObject);
6058
6159 EdgeBrowser.Navigate(URL);
6260
61+ Width:=Ini.ReadInteger(' Window' , ' Width' , Width);
62+ Height:=Ini.ReadInteger(' Window' , ' Height' , Height);
63+ WinSaveSize:=Ini.ReadBool(' Window' , ' SaveSize' , false);
64+
65+ if Ini.ReadBool(' Window' , ' HideMaximize' , false) then
66+ BorderIcons:=Main.BorderIcons-[biMaximize];
67+
68+ if Ini.ReadBool(' Window' , ' HideMinimize' , false) then
69+ BorderIcons:=Main.BorderIcons-[biMinimize];
70+
71+ case Ini.ReadInteger(' Window' , ' BorderStyle' , 0 ) of
72+ 0 : BorderStyle:=bsSizeable;
73+ 1 : BorderStyle:=bsSingle;
74+ 2 : BorderStyle:=bsDialog;
75+ 3 : BorderStyle:=bsSizeToolWin;
76+ 4 : BorderStyle:=bsToolWindow;
77+ end ;
78+
79+ case Ini.ReadInteger(' Window' , ' WindowState' , 0 ) of
80+ 1 : WindowState:=wsMaximized;
81+ 2 : begin BorderStyle:=bsNone; WindowState:=wsMaximized; end ;
82+ // 3: WindowState:=wsMinimized;
83+ end ;
84+
6385 Ini.Free;
64- OldWidth :=Width;
65- OldHeight :=Height;
86+ WinOldWidth :=Width;
87+ WinOldHeight :=Height;
6688end ;
6789
6890end .
0 commit comments