ui(beacon): add flat memo with overlay scroll

This commit is contained in:
2026-08-05 15:06:48 +03:00
parent 0396eeed49
commit 998cb3f0fe
2 changed files with 284 additions and 11 deletions
+5 -11
View File
@@ -17,7 +17,7 @@ interface
uses
Classes, SysUtils, Math, StrUtils,
Forms, Controls, Graphics, ExtCtrls, StdCtrls,
AppTheme, BeaconDecoder, BeaconFEC, RadioController, DpiUtils;
AppTheme, BeaconDecoder, BeaconFEC, RadioController, DpiUtils, FlatMemo;
type
TBeaconScopeForm = class(TForm)
@@ -30,7 +30,7 @@ type
FBulletin: TPanel;
FBulletinTitle: TLabel;
FBulletinHint: TLabel;
FMemo: TMemo; // декодированный текст бюллетеня (AO-40 кадры)
FMemo: TFlatMemo; // декодированный текст бюллетеня (AO-40 кадры)
FTimer: TTimer;
FTheme: TAppTheme;
FLastFrames: Int64; // счётчик кадров на прошлом тике (детект нового)
@@ -135,20 +135,17 @@ begin
FBulletinHint.Font.Color := FTheme.TextDim;
// Бюллетень остаётся обычным read-only memo: текст можно выделить и скопировать.
FMemo := TMemo.Create(Self);
FMemo := TFlatMemo.Create(Self);
FMemo.Parent := FBulletin;
FMemo.Align := alClient;
FMemo.BorderSpacing.Left := DpiScale(12);
FMemo.BorderSpacing.Top := DpiScale(36);
FMemo.BorderSpacing.Right := DpiScale(12);
FMemo.BorderSpacing.Bottom := DpiScale(12);
FMemo.BorderStyle := bsNone;
FMemo.ReadOnly := True;
FMemo.ScrollBars := ssVertical;
FMemo.WordWrap := False;
FMemo.Font.Size := 9;
FMemo.Color := FTheme.BG;
FMemo.Font.Color := FTheme.Text;
FMemo.SetAppTheme(FTheme);
FBox := TPaintBox.Create(Self);
FBox.Parent := Self;
@@ -174,10 +171,7 @@ begin
if FBulletinTitle <> nil then FBulletinTitle.Font.Color := T.MeterOn;
if FBulletinHint <> nil then FBulletinHint.Font.Color := T.TextDim;
if FMemo <> nil then
begin
FMemo.Color := T.BG;
FMemo.Font.Color := T.Text;
end;
FMemo.SetAppTheme(T);
if FBox <> nil then FBox.Invalidate;
end;