Stabilize top VFO frequency spacing

This commit is contained in:
2026-04-28 22:22:31 +03:00
parent 37de08ec82
commit 1b2fbfe2c8
2 changed files with 22 additions and 13 deletions
+7 -1
View File
@@ -32,6 +32,7 @@ type
FColorDim: TColor;
FMinMhzDigits: Integer;
FDimLeadingZeros: Boolean;
FCenterText: Boolean;
FOnChange: TFreqChangeEvent;
FHoverDigit: Integer; // 0=единицы .. 8=100МГц, -1=нет
@@ -69,6 +70,7 @@ type
property ColorDim: TColor read FColorDim write FColorDim;
property MinMhzDigits: Integer read FMinMhzDigits write FMinMhzDigits;
property DimLeadingZeros: Boolean read FDimLeadingZeros write FDimLeadingZeros;
property CenterText: Boolean read FCenterText write FCenterText;
property OnChange: TFreqChangeEvent read FOnChange write FOnChange;
end;
@@ -87,6 +89,7 @@ begin
FColorDim := TColor($00607080);
FMinMhzDigits := 1;
FDimLeadingZeros := False;
FCenterText := True;
FHoverDigit := -1;
FDigitW := 14;
FCharH := 24;
@@ -217,7 +220,10 @@ begin
Inc(LeadingMhzZeros);
TotalW := C.TextWidth(S);
StartX := (Width - TotalW) div 2;
if FCenterText then
StartX := (Width - TotalW) div 2
else
StartX := 2;
if StartX < 2 then StartX := 2;
// Строим карту digit → X