@@ -17,11 +17,11 @@ pub struct Theme {
17
17
#[ serde( with = "ColorDef" ) ]
18
18
selected_tab : Color ,
19
19
#[ serde( with = "ColorDef" ) ]
20
- command_foreground : Color ,
20
+ command_fg : Color ,
21
21
#[ serde( with = "ColorDef" ) ]
22
- command_background : Color ,
22
+ selection_bg : Color ,
23
23
#[ serde( with = "ColorDef" ) ]
24
- command_disabled : Color ,
24
+ disabled_fg : Color ,
25
25
#[ serde( with = "ColorDef" ) ]
26
26
diff_line_add : Color ,
27
27
#[ serde( with = "ColorDef" ) ]
@@ -47,7 +47,15 @@ impl Theme {
47
47
if focus {
48
48
Style :: default ( )
49
49
} else {
50
- Style :: default ( ) . fg ( self . command_disabled )
50
+ Style :: default ( ) . fg ( self . disabled_fg )
51
+ }
52
+ }
53
+
54
+ pub fn title ( & self , focused : bool ) -> Style {
55
+ if focused {
56
+ Style :: default ( ) . modifier ( Modifier :: BOLD )
57
+ } else {
58
+ Style :: default ( ) . fg ( self . disabled_fg )
51
59
}
52
60
}
53
61
@@ -61,11 +69,9 @@ impl Theme {
61
69
62
70
pub fn text ( & self , enabled : bool , selected : bool ) -> Style {
63
71
match ( enabled, selected) {
64
- ( false , _) => Style :: default ( ) . fg ( self . command_disabled ) ,
72
+ ( false , _) => Style :: default ( ) . fg ( self . disabled_fg ) ,
65
73
( true , false ) => Style :: default ( ) ,
66
- ( true , true ) => {
67
- Style :: default ( ) . bg ( self . command_background )
68
- }
74
+ ( true , true ) => Style :: default ( ) . bg ( self . selection_bg ) ,
69
75
}
70
76
}
71
77
@@ -91,12 +97,19 @@ impl Theme {
91
97
92
98
fn apply_select ( & self , style : Style , selected : bool ) -> Style {
93
99
if selected {
94
- style. bg ( self . command_background )
100
+ style. bg ( self . selection_bg )
95
101
} else {
96
102
style
97
103
}
98
104
}
99
105
106
+ pub fn diff_hunk_marker ( & self , selected : bool ) -> Style {
107
+ match selected {
108
+ false => Style :: default ( ) . fg ( self . disabled_fg ) ,
109
+ true => Style :: default ( ) . bg ( self . selection_bg ) ,
110
+ }
111
+ }
112
+
100
113
pub fn diff_line (
101
114
& self ,
102
115
typ : DiffLineType ,
@@ -124,11 +137,11 @@ impl Theme {
124
137
125
138
pub fn toolbar ( & self , enabled : bool ) -> Style {
126
139
if enabled {
127
- Style :: default ( ) . fg ( self . command_foreground )
140
+ Style :: default ( ) . fg ( self . command_fg )
128
141
} else {
129
- Style :: default ( ) . fg ( self . command_disabled )
142
+ Style :: default ( ) . fg ( self . disabled_fg )
130
143
}
131
- . bg ( self . command_background )
144
+ . bg ( self . selection_bg )
132
145
}
133
146
134
147
pub fn commit_hash ( & self , selected : bool ) -> Style {
@@ -195,15 +208,15 @@ impl Default for Theme {
195
208
fn default ( ) -> Self {
196
209
Self {
197
210
selected_tab : Color :: Yellow ,
198
- command_foreground : Color :: White ,
199
- command_background : Color :: Rgb ( 0 , 0 , 100 ) ,
200
- command_disabled : Color :: DarkGray ,
211
+ command_fg : Color :: White ,
212
+ selection_bg : Color :: Rgb ( 0 , 0 , 100 ) ,
213
+ disabled_fg : Color :: DarkGray ,
201
214
diff_line_add : Color :: Green ,
202
215
diff_line_delete : Color :: Red ,
203
216
diff_file_added : Color :: LightGreen ,
204
217
diff_file_removed : Color :: LightRed ,
205
218
diff_file_moved : Color :: LightMagenta ,
206
- diff_file_modified : Color :: Yellow ,
219
+ diff_file_modified : Color :: LightYellow ,
207
220
commit_hash : Color :: Magenta ,
208
221
commit_time : Color :: Blue ,
209
222
commit_author : Color :: Green ,
0 commit comments