mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
Add FlatProgressBar — canvas-rendered cross-platform progress bar
Replaces TProgressBar in TWisdomProgressDialog with TFlatProgressBar, drawn entirely via Canvas (plain rectangle, no native widget styling). Dialog now receives the active TAppTheme so both dark and light themes are applied consistently to background, label, and progress bar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+17
-11
@@ -24,7 +24,8 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, StrUtils, FreqDisplay, DeviceForm, VfoOverlay, SampleRateOverlay,
|
||||
FlatButton, FlatSlider, FlatDropDown, AppTheme, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, ExtCtrls, ComCtrls, Buttons, Menus, Math, Types,
|
||||
StdCtrls, ExtCtrls, Buttons, Menus, Math, Types,
|
||||
FlatProgressBar,
|
||||
LCLIntf, LCLType, GraphType,
|
||||
HPSDRProtocol, HPSDRNetwork,
|
||||
WDSP, WDSPEngine, AudioOutput, AudioInput,
|
||||
@@ -742,13 +743,14 @@ type
|
||||
TWisdomProgressDialog = class(TForm)
|
||||
private
|
||||
FInfoLabel: TLabel;
|
||||
FProgress: TProgressBar;
|
||||
FProgress: TFlatProgressBar;
|
||||
FTimer: TTimer;
|
||||
FThread: TWisdomBuildThread;
|
||||
FPhase: Integer;
|
||||
procedure TimerTick(Sender: TObject);
|
||||
public
|
||||
constructor Create(AOwner: TComponent; AThread: TWisdomBuildThread); reintroduce;
|
||||
constructor Create(AOwner: TComponent; AThread: TWisdomBuildThread;
|
||||
const ATheme: TAppTheme); reintroduce;
|
||||
end;
|
||||
|
||||
var
|
||||
@@ -783,7 +785,7 @@ begin
|
||||
end;
|
||||
|
||||
constructor TWisdomProgressDialog.Create(AOwner: TComponent;
|
||||
AThread: TWisdomBuildThread);
|
||||
AThread: TWisdomBuildThread; const ATheme: TAppTheme);
|
||||
begin
|
||||
inherited CreateNew(AOwner);
|
||||
FThread := AThread;
|
||||
@@ -795,26 +797,27 @@ begin
|
||||
Position := poScreenCenter;
|
||||
BorderStyle := bsDialog;
|
||||
BorderIcons := [];
|
||||
Color := CLR_BG;
|
||||
Color := ATheme.BG;
|
||||
Font.Name := 'Courier New';
|
||||
Font.Size := 9;
|
||||
Font.Color := CLR_TEXT;
|
||||
Font.Color := ATheme.Text;
|
||||
|
||||
FInfoLabel := TLabel.Create(Self);
|
||||
FInfoLabel.Parent := Self;
|
||||
FInfoLabel.SetBounds(16, 16, 480, 40);
|
||||
FInfoLabel.AutoSize := False;
|
||||
FInfoLabel.WordWrap := True;
|
||||
FInfoLabel.Font.Color := CLR_TEXT;
|
||||
FInfoLabel.Font.Color := ATheme.Text;
|
||||
FInfoLabel.Caption :=
|
||||
'Creating FFTW wisdom for WDSP. This is done once and may take a while on the first run.';
|
||||
|
||||
FProgress := TProgressBar.Create(Self);
|
||||
FProgress := TFlatProgressBar.Create(Self);
|
||||
FProgress.Parent := Self;
|
||||
FProgress.SetBounds(16, 72, 480, 22);
|
||||
FProgress.Min := 0;
|
||||
FProgress.Max := 100;
|
||||
FProgress.Min := 0;
|
||||
FProgress.Max := 100;
|
||||
FProgress.Position := 0;
|
||||
FProgress.SetAppTheme(ATheme);
|
||||
|
||||
FTimer := TTimer.Create(Self);
|
||||
FTimer.Interval := 250;
|
||||
@@ -3686,7 +3689,10 @@ begin
|
||||
|
||||
BuildThread := TWisdomBuildThread.Create(WisdomDir);
|
||||
try
|
||||
Dlg := TWisdomProgressDialog.Create(Self, BuildThread);
|
||||
if FLightTheme then
|
||||
Dlg := TWisdomProgressDialog.Create(Self, BuildThread, LightTheme)
|
||||
else
|
||||
Dlg := TWisdomProgressDialog.Create(Self, BuildThread, DarkTheme);
|
||||
try
|
||||
Dlg.ShowModal;
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user