Fix HiDPI layout: ruler height, left panel overlap, VFO button clipping

- RelayoutBelowBands: replace hardcoded Inc(Y,76) with actual panel
  heights so Mode/Filter/RX panels don't overlap at scaled DPI
- ResizeSpectrumPanels, SplitterMouseMove/Up: make RULER_H dynamic
  via MulDiv(18, Screen.PixelsPerInch, 96) so frequency ruler is tall
  enough to fit text at 125%/150% DPI
- LayoutTopVfoBlock: use BtnTopVfoASelect.Width / BtnTopVfoBSelect.Width
  instead of constant VFO_BTN_W so FreqDisp doesn't clip the A/TX buttons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 19:13:07 +03:00
co-authored by Claude Sonnet 4.6
parent 66608da938
commit 0dd7c6f34f
+11 -8
View File
@@ -1862,12 +1862,13 @@ var
DeltaY: Integer;
NewSH: Integer;
TopOff, AvailH: Integer;
RULER_H: Integer;
const
RULER_H = 18;
SPLITTER_H = 5;
MIN_SH = 60;
MIN_WH = 40;
begin
RULER_H := MulDiv(18, Screen.PixelsPerInch, 96);
if not FSplitterDrag then Exit;
P := PanelRight.ScreenToClient(PanelSplitter.ClientToScreen(Point(X, Y)));
DeltaY := P.Y - FSplitterDragY0;
@@ -1893,12 +1894,13 @@ var
DeltaY: Integer;
NewSH: Integer;
TopOff, AvailH: Integer;
RULER_H: Integer;
const
RULER_H = 18;
SPLITTER_H = 5;
MIN_SH = 60;
MIN_WH = 40;
begin
RULER_H := MulDiv(18, Screen.PixelsPerInch, 96);
if not FSplitterDrag then Exit;
FSplitterDrag := False;
{$IFDEF WINDOWS}
@@ -1961,8 +1963,8 @@ begin
Canvas.Font.Name := FreqDispB.FontName;
Canvas.Font.Size := FreqDispB.FontSize;
Canvas.Font.Style := [fsBold];
FreqDispA.Left := VFO_BTN_W + VFO_BTN_FREQ_GAP - VFO_FREQ_LEFT_PAD;
FreqDispB.Left := VFO_B_LEFT_PAD + VFO_BTN_W + VFO_BTN_FREQ_GAP - VFO_FREQ_LEFT_PAD;
FreqDispA.Left := BtnTopVfoASelect.Width + VFO_BTN_FREQ_GAP - VFO_FREQ_LEFT_PAD;
FreqDispB.Left := VFO_B_LEFT_PAD + BtnTopVfoBSelect.Width + VFO_BTN_FREQ_GAP - VFO_FREQ_LEFT_PAD;
FreqTextW := Canvas.TextWidth(StringOfChar('0', Max(3, FFreqMhzDigits)) + '.000.000');
NeedFreqAW := FreqDispA.Left + FreqTextW + VFO_FREQ_LEFT_PAD + VFO_FREQ_RIGHT_PAD;
NeedFreqBW := FreqDispB.Left + FreqTextW + VFO_FREQ_LEFT_PAD + VFO_FREQ_RIGHT_PAD;
@@ -2089,14 +2091,15 @@ end;
procedure TMainForm.ResizeSpectrumPanels;
const
RULER_H = 18;
SPLITTER_H = 5;
MIN_SH = 60; // минимальная высота спектра
MIN_WH = 40; // минимальная высота водопада
var
RW, RH, SH, WH, TopOff: Integer;
AvailH: Integer;
RULER_H: Integer;
begin
RULER_H := MulDiv(18, Screen.PixelsPerInch, 96);
if PanelRight = nil then Exit;
if Assigned(FSpecView) then SyncSpecViewFreq;
RW := PanelRight.ClientWidth;
@@ -5622,9 +5625,9 @@ var
begin
if PanelBands = nil then Exit;
Y := PanelBands.Top + PanelBands.Height + 2;
PanelMode.Top := Y; Inc(Y, 76);
PanelFilter.Top := Y; Inc(Y, 76);
BtnCTun.Top := Y; BtnDUP.Top := Y; Inc(Y, 30); // BTN_H(26) + 4
PanelMode.Top := Y; Y := Y + PanelMode.Height + 2;
PanelFilter.Top := Y; Y := Y + PanelFilter.Height + 2;
BtnCTun.Top := Y; BtnDUP.Top := Y; Y := Y + BtnCTun.Height + 4;
PanelRX.Top := Y;
end;