1 module fluid.default_theme;
2 
3 import fluid.style;
4 
5 /// Theme with no properties set.
6 ///
7 /// Unlike `Theme.init` or `null`, which will be replaced by fluidDefaultTheme or the parent's theme, this can be used as
8 /// a valid theme for any node. This makes it useful for automatic tests, since it has guaranteed no margins, padding,
9 /// or other properties that may confuse the tester.
10 Theme nullTheme;
11 
12 /// Default theme that Fluid will use if no theme is supplied. It is a very simple theme that does the minimum to make
13 /// the role of each node understandable.
14 Theme fluidDefaultTheme;
15 
16 static this() {
17 
18     nullTheme = Theme.init.makeTheme!q{};
19 
20     fluidDefaultTheme = Theme.init.makeTheme!q{
21 
22         textColor = color("000");
23 
24         Frame.styleAdd!q{
25 
26             backgroundColor = color("fff");
27 
28         };
29 
30         Button!().styleAdd!q{
31 
32             backgroundColor = color("eee");
33             mouseCursor = FluidMouseCursor.pointer;
34 
35             margin.sideY = 2;
36             padding.sideX = 6;
37 
38             focusStyleAdd.backgroundColor = color("ddd");
39             hoverStyleAdd.backgroundColor = color("ccc");
40             pressStyleAdd.backgroundColor = color("aaa");
41             disabledStyleAdd!q{
42 
43                 textColor = color("000a");
44                 backgroundColor = color("eee5");
45 
46             };
47 
48         };
49 
50         TextInput.styleAdd!q{
51 
52             backgroundColor = color("fffc");
53             borderStyle = colorBorder(color("aaa"));
54             mouseCursor = FluidMouseCursor.text;
55 
56             margin.sideY = 2;
57             padding.sideX = 6;
58             border.sideBottom = 2;
59 
60             emptyStyleAdd.textColor = color("000a");
61             focusStyleAdd.backgroundColor = color("fff");
62             disabledStyleAdd!q{
63 
64                 textColor = color("000a");
65                 backgroundColor = color("fff5");
66 
67             };
68 
69         };
70 
71         ScrollInput.styleAdd!q{
72 
73             backgroundColor = color("aaa");
74 
75             backgroundStyleAdd.backgroundColor = color("eee");
76             hoverStyleAdd.backgroundColor = color("888");
77             focusStyleAdd.backgroundColor = color("777");
78             pressStyleAdd.backgroundColor = color("555");
79             disabledStyleAdd.backgroundColor = color("aaa5");
80 
81         };
82 
83         FileInput.unselectedStyleAdd.backgroundColor = color("fff");
84         FileInput.selectedStyleAdd.backgroundColor = color("ff512f");
85 
86     };
87 
88 
89 }