-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathAbout_Form.pas
92 lines (78 loc) · 2.33 KB
/
About_Form.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
unit About_Form;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
CFX.Forms, Vcl.Imaging.pngimage, Cod.Visual.Image, Vcl.ExtCtrls,
CFX.ThemeManager, CFX.Types, Vcl.StdCtrls, Vcl.TitleBarCtrls,
Cod.Visual.Button, Cod.Visual.SplashScreen, ShellAPI, CFX.BlurMaterial,
CFX.Controls, CFX.Button, CFX.Panels, Cod.SysUtils;
type
TAbout = class(FXForm)
CImage1: CImage;
Shape1: TShape;
Label1: TLabel;
VerLabel: TLabel;
Label2: TLabel;
TitleBarPanel1: TTitleBarPanel;
Label3: TLabel;
FXBlurMaterial1: FXBlurMaterial;
Shape2: TShape;
FXPanel1: FXPanel;
CButton2: CButton;
CButton3: CButton;
CButton4: CButton;
CButton5: CButton;
FXButton1: FXButton;
CButton1: CButton;
procedure FormCreate(Sender: TObject);
procedure CButton2Click(Sender: TObject);
procedure FXBlurMaterial1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
procedure ThemeChange(Sender: TObject; ThemeChange: FXThemeType; DarkTheme: boolean; Accent: TColor);
public
{ Public declarations }
end;
var
About: TAbout;
implementation
{$R *.dfm}
procedure TAbout.CButton2Click(Sender: TObject);
var
URL: string;
begin
case CButton(Sender).Tag of
1: URL := 'mailto:codrut@codrutsoft.com';
2: URL := 'https://www.codrutsoft.com';
3: URL := 'https://www.twitter.com/LAVAplanks';
4: URL := 'https://www.youtube.com/@codrutsoft';
5: URL := 'https://www.paypal.com/paypalme/codrutpetcu';
end;
ShellRun(URL, true);
end;
procedure TAbout.FormCreate(Sender: TObject);
begin
// Form
OnThemeChange := ThemeChange;
// UI
Shape1.Brush.Color := ThemeManager.AccentColor;
Self.CustomTitleBar.Height := 0;
end;
procedure TAbout.FXBlurMaterial1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(Self.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
end;
procedure TAbout.ThemeChange(Sender: TObject; ThemeChange: FXThemeType;
DarkTheme: boolean; Accent: TColor);
var
I: integer;
begin
for I := 0 to ComponentCount - 1 do
if Components[I] is TLabel then
TLabel(Components[I]).Font.Color := ThemeManager.SystemColor.ForeGround;
end;
end.