refactor(help): enable help bar by default and add help keybinding (#122)

This commit is contained in:
Alexandre Pasmantier 2024-12-15 00:54:14 +01:00 committed by GitHub
parent 9809e742d8
commit 37b2dda729
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 23 additions and 16 deletions

View File

@ -37,7 +37,7 @@ use_nerd_font_icons = false
ui_scale = 100
# Whether to show the top help bar in the UI by default
# This option can be toggled with the (default) `ctrl-g` keybinding
show_help_bar = false
show_help_bar = true
# Where to place the input bar in the UI (top or bottom)
input_bar_position = "bottom"
# The theme to use for the UI

View File

@ -29,6 +29,7 @@ pub enum DisplayableAction {
ToggleRemoteControl,
Cancel,
Quit,
ToggleHelpBar,
}
impl Display for DisplayableAction {
@ -44,6 +45,7 @@ impl Display for DisplayableAction {
DisplayableAction::ToggleRemoteControl => "Toggle Remote control",
DisplayableAction::Cancel => "Cancel",
DisplayableAction::Quit => "Quit",
DisplayableAction::ToggleHelpBar => "Toggle help bar",
};
write!(f, "{action}")
}
@ -149,12 +151,14 @@ fn build_keybindings_table_for_channel<'a>(
));
// MISC line (quit, help, etc.)
// Quit ⏼
let quit_keys =
keybindings.bindings.get(&DisplayableAction::Quit).unwrap();
let quit_row = Row::new(build_cells_for_group(
"Quit",
quit_keys,
// Toggle help bar
let toggle_help_bar_keys = keybindings
.bindings
.get(&DisplayableAction::ToggleHelpBar)
.unwrap();
let toggle_help_bar_row = Row::new(build_cells_for_group(
"Toggle help bar",
toggle_help_bar_keys,
colorscheme.help.metadata_field_name_fg,
colorscheme.mode.channel,
));
@ -169,7 +173,7 @@ fn build_keybindings_table_for_channel<'a>(
copy_entry_row,
send_to_channel_row,
switch_channels_row,
quit_row,
toggle_help_bar_row,
],
widths,
)

View File

@ -10,10 +10,13 @@ lazy_static! {
include_str!("../../../../themes/gruvbox-dark.toml"),
);
m.insert(
"catppuccin",
include_str!("../../../../themes/catppuccin.toml"),
"catppuccin-mocha",
include_str!("../../../../themes/catppuccin-mocha.toml"),
);
m.insert(
"nord-dark",
include_str!("../../../../themes/nord-dark.toml"),
);
m.insert("nord", include_str!("../../../../themes/nord.toml"));
m.insert(
"solarized-dark",
include_str!("../../../../themes/solarized-dark.toml"),

View File

@ -587,8 +587,8 @@ impl KeyBindings {
),
),
(
DisplayableAction::Quit,
serialized_keys_for_actions(self, &[Action::Quit]),
DisplayableAction::ToggleHelpBar,
serialized_keys_for_actions(self, &[Action::ToggleHelp]),
),
]);

View File

@ -7,9 +7,9 @@ dimmed_text_fg = '#6c7086'
input_text_fg = '#f38ba8'
result_count_fg = '#f38ba8'
# results
result_name_fg = '#b4befe'
result_name_fg = '#89b4fa'
result_line_number_fg = '#f9e2af'
result_value_fg = '#a6adc8'
result_value_fg = '#b4befe'
selection_bg = '#313244'
match_fg = '#f38ba8'
# preview

View File

@ -1,6 +1,6 @@
# general
background = '#2e3440'
border_fg = '#434c5e'
border_fg = '#81a1c1'
text_fg = '#d8dee9'
dimmed_text_fg = '#4c566a'
# input