Add Spectrum gradient fill toggle in settings

Mirror the existing Wideband gradient fill option for the main spectrum:
a "Spectrum gradient fill" checkbox on the Display settings tab gates the
under-curve gradient in TSpectrumView.DrawSpectrum. The curve, grid,
filter band and VFO markers always draw; only the gradient is optional.

Persisted as spectrum_fill in settings JSON (default True, preserving
current appearance). Wired through Settings -> SettingsForm visibility
event -> MainForm -> TSpectrumView.FillSpectrum, same path as
WidebandFill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Uladzimir Karpenka
2026-05-29 15:24:33 +03:00
co-authored by Claude Opus 4.8
parent 2a7bf8528a
commit 655d242d02
4 changed files with 48 additions and 10 deletions
+11 -3
View File
@@ -241,6 +241,7 @@ type
FShowWaterfall: Boolean;
FShowWideband: Boolean;
FWidebandFill: Boolean;
FSpectrumFill: Boolean;
FDisplayFPS: Integer;
FWaterfallDirty: Boolean;
FWidebandDirty: Boolean;
@@ -729,7 +730,7 @@ type
function PullSoundCardMic(MaxN: Integer): Integer;
function BuildMicLineSelectByte: Byte;
procedure ApplyVisibility(ShowSpectrum, ShowWaterfall, ShowWideband,
WidebandFill: Boolean);
WidebandFill, SpectrumFill: Boolean);
procedure ApplyFPS(FPS: Integer);
procedure ApplyFreqMhzDigits(Digits: Integer);
@@ -951,6 +952,7 @@ begin
Result.ShowWaterfall := FShowWaterfall;
Result.ShowWideband := FShowWideband;
Result.WidebandFill := FWidebandFill;
Result.SpectrumFill := FSpectrumFill;
Result.DisplayDuplex := FDisplayDuplex;
Result.DisplayFPS := FDisplayFPS;
Result.LightTheme := FLightTheme;
@@ -1295,6 +1297,7 @@ begin
FShowWaterfall := True;
FShowWideband := False;
FWidebandFill := False;
FSpectrumFill := True;
FDisplayFPS := 60;
FFreqMhzDigits := 3;
FSplitterRatio := 0.40;
@@ -4098,6 +4101,8 @@ begin
FWidebandFill := G_Settings.WidebandFill;
if Assigned(FWidebandView) then
FWidebandView.SetFillSpectrum(FWidebandFill);
FSpectrumFill := G_Settings.SpectrumFill;
FSpecView.FillSpectrum := FSpectrumFill;
FDisplayDuplex := G_Settings.DisplayDuplex;
if BtnDUP <> nil then StyleButton(BtnDUP, FDisplayDuplex);
if G_Settings.DisplayFPS > 0 then
@@ -7503,14 +7508,16 @@ begin
end;
procedure TMainForm.ApplyVisibility(ShowSpectrum, ShowWaterfall,
ShowWideband, WidebandFill: Boolean);
ShowWideband, WidebandFill, SpectrumFill: Boolean);
begin
FShowSpectrum := ShowSpectrum;
FShowWaterfall := ShowWaterfall;
FShowWideband := ShowWideband;
FWidebandFill := WidebandFill;
FSpectrumFill := SpectrumFill;
if Assigned(FWidebandView) then
FWidebandView.SetFillSpectrum(FWidebandFill);
FSpecView.FillSpectrum := FSpectrumFill;
if Assigned(FNetwork) and FNetwork.Connected then
FNetwork.ConfigureWideband(0, FShowWideband, 512, 16, 70, 32);
ResizeSpectrumPanels;
@@ -7597,7 +7604,8 @@ begin
FCATLastGlobal.CATTcpPort);
// Перечисляем PA устройства
SF.RefreshAudioDevices(FAudioOut, FAudioIn);
SF.LoadVisibility(FShowSpectrum, FShowWaterfall, FShowWideband, FWidebandFill);
SF.LoadVisibility(FShowSpectrum, FShowWaterfall, FShowWideband, FWidebandFill,
FSpectrumFill);
SF.LoadWfAGCNF(FWfAGCEnabled, FWfNFEnabled);
SF.LoadADCSettings(FDitherEnabled, FRandomEnabled);
SF.LoadWebSettings(FWebEnabled, FWebPort, FWebBindAddr, FWebUser, FWebPass);