Fix window geometry scaling and close deadlock

This commit is contained in:
2026-05-24 16:19:22 +03:00
parent 0dc04ffcad
commit 8624116f0c
3 changed files with 75 additions and 73 deletions
+7 -5
View File
@@ -282,8 +282,8 @@ type
class procedure DefaultGlobal(out G: TGlobalSettings);
class procedure DefaultTX(out T: TTXSettings);
// Размер окна — не привязан к MAC, хранится в корне JSON
procedure SaveWindowBounds(L, T, W, H: Integer);
procedure LoadWindowBounds(out L, T, W, H: Integer);
procedure SaveWindowBounds(L, T, W, H, DPI: Integer);
procedure LoadWindowBounds(out L, T, W, H, DPI: Integer);
procedure SaveStartupPreview(VfoA, VfoB: Double; SampleRate: Integer);
function LoadStartupPreview(out VfoA, VfoB: Double; out SampleRate: Integer): Boolean;
procedure SaveAudioBufferSize(BufferSize: Integer);
@@ -757,7 +757,7 @@ begin
B.FMStepIdx := EnsureRange(JI(O,'fmstep_idx', B.FMStepIdx), 0, 3);
end;
procedure TSettingsManager.SaveWindowBounds(L, T, W, H: Integer);
procedure TSettingsManager.SaveWindowBounds(L, T, W, H, DPI: Integer);
var O: TJSONObject;
begin
O := EnsureObj(FRoot, 'window');
@@ -765,18 +765,20 @@ begin
JW(O, 'top', T);
JW(O, 'width', W);
JW(O, 'height', H);
JW(O, 'dpi', DPI);
end;
procedure TSettingsManager.LoadWindowBounds(out L, T, W, H: Integer);
procedure TSettingsManager.LoadWindowBounds(out L, T, W, H, DPI: Integer);
var O: TJSONObject;
begin
L := 80; T := 80; W := 1400; H := 900;
L := 80; T := 80; W := 1400; H := 900; DPI := 0;
if FRoot.Find('window') = nil then Exit;
O := EnsureObj(FRoot, 'window');
L := JI(O, 'left', 80);
T := JI(O, 'top', 80);
W := JI(O, 'width', 1400);
H := JI(O, 'height', 900);
DPI := JI(O, 'dpi', 0);
end;
procedure TSettingsManager.SaveStartupPreview(VfoA, VfoB: Double; SampleRate: Integer);