-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathuStyles.pas
63 lines (53 loc) · 1.51 KB
/
uStyles.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
// These styles were downloaded from GetIt Package Manager
unit uStyles;
interface
uses
System.SysUtils,
System.Classes,
FMX.Types,
FMX.Controls;
type
TdmStyles = class(TDataModule)
StyleCopperDark: TStyleBook;
StyleCopper: TStyleBook;
StyleCoralCrystal: TStyleBook;
StyleCoralDark: TStyleBook;
StyleDiamond: TStyleBook;
StyleEmeraldCrystal: TStyleBook;
StyleEmeraldDark: TStyleBook;
StyleCalypso: TStyleBook;
StyleCalypsoSE: TStyleBook;
StyleMaterialOxfordBlue: TStyleBook;
StyleMaterialOxfordBlueSE: TStyleBook;
StyleMaterialPatternsBlue: TStyleBook;
StylePuertoRico: TStyleBook;
StyleStellar: TStyleBook;
StyleUbuntuClearFantasy: TStyleBook;
private
FisDarkMode: Boolean;
{ Private declarations }
public
{ Public declarations }
function isDarkMode(StyleName: String): Boolean;
end;
var
dmStyles: TdmStyles;
implementation
{%CLASSGROUP 'FMX.Controls.TControl'}
{$R *.dfm}
{ TdmStyles }
function TdmStyles.isDarkMode(StyleName: String): Boolean;
const
DarkStyles: array[0..6] of string = ('Copper Dark', 'Coral Crystal','Emerald Crystal','Calypso','Calypso SE',
'Material Oxford Blue','Material Oxford Blue SE');
LightStyles: array[0..4] of string = ('Copper', 'Coral Dark','Diamond','Emerald Dark','Material Patterns Blue');
begin
result := false;
for var I := 0 to Length(DarkStyles) do
if DarkStyles[I] = StyleName then
begin
result := true;
break;
end;
end;
end.