@@ -38,22 +38,6 @@ pub struct Theme {
38
38
commit_author : Color ,
39
39
}
40
40
41
- pub const DARK_THEME : Theme = Theme {
42
- selected_tab : Color :: Yellow ,
43
- command_foreground : Color :: White ,
44
- command_background : Color :: Rgb ( 0 , 0 , 100 ) ,
45
- command_disabled : Color :: DarkGray ,
46
- diff_line_add : Color :: Green ,
47
- diff_line_delete : Color :: Red ,
48
- diff_file_added : Color :: LightGreen ,
49
- diff_file_removed : Color :: LightRed ,
50
- diff_file_moved : Color :: LightMagenta ,
51
- diff_file_modified : Color :: Yellow ,
52
- commit_hash : Color :: Magenta ,
53
- commit_time : Color :: Blue ,
54
- commit_author : Color :: Green ,
55
- } ;
56
-
57
41
impl Theme {
58
42
pub fn block ( & self , focus : bool ) -> Style {
59
43
if focus {
@@ -196,8 +180,29 @@ impl Theme {
196
180
if let Ok ( x) = Theme :: read_file ( Theme :: get_theme_file ( ) ) {
197
181
x
198
182
} else {
199
- DARK_THEME . save ( ) . unwrap_or_default ( ) ;
200
- DARK_THEME
183
+ let res = Self :: default ( ) ;
184
+ res. save ( ) . unwrap_or_default ( ) ;
185
+ res
186
+ }
187
+ }
188
+ }
189
+
190
+ impl Default for Theme {
191
+ fn default ( ) -> Self {
192
+ Self {
193
+ selected_tab : Color :: Yellow ,
194
+ command_foreground : Color :: White ,
195
+ command_background : Color :: Rgb ( 0 , 0 , 100 ) ,
196
+ command_disabled : Color :: DarkGray ,
197
+ diff_line_add : Color :: Green ,
198
+ diff_line_delete : Color :: Red ,
199
+ diff_file_added : Color :: LightGreen ,
200
+ diff_file_removed : Color :: LightRed ,
201
+ diff_file_moved : Color :: LightMagenta ,
202
+ diff_file_modified : Color :: Yellow ,
203
+ commit_hash : Color :: Magenta ,
204
+ commit_time : Color :: Blue ,
205
+ commit_author : Color :: Green ,
201
206
}
202
207
}
203
208
}
0 commit comments