Skip to content

Commit 080d66d

Browse files
authored
Merge pull request #96 from daewon/ui-theme-customization
Add ui.theme config
2 parents 39de959 + 2a668a5 commit 080d66d

23 files changed

Lines changed: 552 additions & 167 deletions

Cargo.lock

Lines changed: 61 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ itsuki = "0.2.1"
3939
laurier = "0.3.0"
4040
once_cell = "1.21.3"
4141
open = "5.3.3"
42-
ratatui = "0.30.0"
42+
ratatui = { version = "0.30.0", features = ["serde"] }
4343
ratatui-image = { version = "10.0.4", default-features = false, features = [
4444
"crossterm",
4545
"image-defaults",

docs/src/configurations/config-file-format.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ date_format = "%Y-%m-%d %H:%M:%S"
2323
[ui.help]
2424
max_help_width = 100
2525

26+
[ui.theme]
27+
bg = "reset"
28+
fg = "reset"
29+
divider = "dark_gray"
30+
link = "blue"
31+
list_selected_bg = "#FFD166"
32+
list_selected_fg = "black"
33+
list_selected_inactive_bg = "dark_gray"
34+
list_selected_inactive_fg = "black"
35+
list_filter_match = "red"
36+
detail_selected = "cyan"
37+
dialog_selected = "cyan"
38+
preview_line_number = "dark_gray"
39+
help_key_fg = "yellow"
40+
status_help = "dark_gray"
41+
status_info = "blue"
42+
status_success = "green"
43+
status_warn = "yellow"
44+
status_error = "red"
45+
object_dir_bold = true
46+
2647
[preview]
2748
highlight = false
2849
highlight_theme = "base16-ocean.dark"
@@ -119,6 +140,169 @@ The maximum width of the keybindings display area in the help.
119140
- type: `usize`
120141
- default: `100`
121142

143+
### `ui.theme.bg`
144+
145+
The default background color used across the UI.
146+
147+
- type: `string`
148+
- default: `reset`
149+
150+
### `ui.theme.fg`
151+
152+
The default foreground color used across the UI.
153+
154+
- type: `string`
155+
- default: `reset`
156+
157+
### `ui.theme.divider`
158+
159+
The color of dividers and separators.
160+
161+
- type: `string`
162+
- default: `dark_gray`
163+
164+
### `ui.theme.link`
165+
166+
The color used for links in the help view.
167+
168+
- type: `string`
169+
- default: `blue`
170+
171+
### `ui.theme.list_selected_bg`
172+
173+
The background color of the selected row in bucket and object lists.
174+
175+
- type: `string`
176+
- default: `cyan`
177+
178+
Theme colors are deserialized by Ratatui's `Color` serde support.
179+
Supported examples include named colors such as `cyan`, `dark_gray`, `bright_white`,
180+
hex colors such as `#FFD166`, and indexed colors such as `42`.
181+
182+
### `ui.theme.list_selected_fg`
183+
184+
The foreground color of the selected row in bucket and object lists.
185+
186+
- type: `string`
187+
- default: `black`
188+
189+
Supports the same color formats as `ui.theme.list_selected_bg`.
190+
191+
### `ui.theme.list_selected_inactive_bg`
192+
193+
The background color of the selected row when the list is inactive.
194+
195+
- type: `string`
196+
- default: `dark_gray`
197+
198+
Supports the same color formats as `ui.theme.list_selected_bg`.
199+
200+
### `ui.theme.list_selected_inactive_fg`
201+
202+
The foreground color of the selected row when the list is inactive.
203+
204+
- type: `string`
205+
- default: `black`
206+
207+
Supports the same color formats as `ui.theme.list_selected_bg`.
208+
209+
### `ui.theme.list_filter_match`
210+
211+
The color used to highlight matched filter text in lists.
212+
213+
- type: `string`
214+
- default: `red`
215+
216+
Supports the same color formats as `ui.theme.list_selected_bg`.
217+
218+
### `ui.theme.detail_selected`
219+
220+
The color used for the selected tab and selection accents in the object detail page.
221+
222+
- type: `string`
223+
- default: `cyan`
224+
225+
Supports the same color formats as `ui.theme.list_selected_bg`.
226+
227+
### `ui.theme.dialog_selected`
228+
229+
The color used to highlight the selected choice in dialogs.
230+
231+
- type: `string`
232+
- default: `cyan`
233+
234+
Supports the same color formats as `ui.theme.list_selected_bg`.
235+
236+
### `ui.theme.preview_line_number`
237+
238+
The color of line numbers in the text preview.
239+
240+
- type: `string`
241+
- default: `dark_gray`
242+
243+
Supports the same color formats as `ui.theme.list_selected_bg`.
244+
245+
### `ui.theme.help_key_fg`
246+
247+
The foreground color of key labels in the help view.
248+
249+
- type: `string`
250+
- default: `yellow`
251+
252+
Supports the same color formats as `ui.theme.list_selected_bg`.
253+
254+
### `ui.theme.status_help`
255+
256+
The color used for help/status hint messages.
257+
258+
- type: `string`
259+
- default: `dark_gray`
260+
261+
Supports the same color formats as `ui.theme.list_selected_bg`.
262+
263+
### `ui.theme.status_info`
264+
265+
The color used for informational status messages.
266+
267+
- type: `string`
268+
- default: `blue`
269+
270+
Supports the same color formats as `ui.theme.list_selected_bg`.
271+
272+
### `ui.theme.status_success`
273+
274+
The color used for success status messages.
275+
276+
- type: `string`
277+
- default: `green`
278+
279+
Supports the same color formats as `ui.theme.list_selected_bg`.
280+
281+
### `ui.theme.status_warn`
282+
283+
The color used for warning status messages.
284+
285+
- type: `string`
286+
- default: `yellow`
287+
288+
Supports the same color formats as `ui.theme.list_selected_bg`.
289+
290+
### `ui.theme.status_error`
291+
292+
The color used for error status messages.
293+
294+
- type: `string`
295+
- default: `red`
296+
297+
Supports the same color formats as `ui.theme.list_selected_bg`.
298+
299+
### `ui.theme.object_dir_bold`
300+
301+
Whether directory names should be rendered in bold.
302+
303+
- type: `bool`
304+
- default: `true`
305+
122306
### `preview.highlight`
123307

124308
Whether syntax highlighting is enabled in the object preview.

0 commit comments

Comments
 (0)