mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-03 01:50:12 +00:00
parent
a602dda347
commit
1f0c178a2d
@ -6,11 +6,13 @@ use super::themes::DEFAULT_THEME;
|
||||
|
||||
const DEFAULT_UI_SCALE: u16 = 100;
|
||||
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Hash)]
|
||||
#[serde(default)]
|
||||
pub struct UiConfig {
|
||||
pub use_nerd_font_icons: bool,
|
||||
pub ui_scale: u16,
|
||||
pub no_help: bool,
|
||||
pub show_help_bar: bool,
|
||||
pub show_preview_panel: bool,
|
||||
#[serde(default)]
|
||||
@ -25,6 +27,7 @@ impl Default for UiConfig {
|
||||
Self {
|
||||
use_nerd_font_icons: false,
|
||||
ui_scale: DEFAULT_UI_SCALE,
|
||||
no_help: false,
|
||||
show_help_bar: false,
|
||||
show_preview_panel: true,
|
||||
input_bar_position: InputPosition::Top,
|
||||
|
@ -225,6 +225,7 @@ pub fn draw(ctx: &Ctx, f: &mut Frame<'_>, area: Rect) -> Result<Layout> {
|
||||
.to_string(),
|
||||
// only show the preview keybinding hint if there's actually something to preview
|
||||
ctx.tv_state.preview_state.enabled,
|
||||
ctx.config.ui.no_help,
|
||||
)?;
|
||||
|
||||
// input box
|
||||
|
@ -253,8 +253,12 @@ pub fn draw_results_list(
|
||||
help_keybinding: &str,
|
||||
preview_keybinding: &str,
|
||||
preview_togglable: bool,
|
||||
no_help: bool,
|
||||
) -> Result<()> {
|
||||
let mut toggle_hints = format!(" help: <{help_keybinding}> ",);
|
||||
let mut toggle_hints = String::new();
|
||||
if !no_help {
|
||||
toggle_hints.push_str(&format!(" help: <{help_keybinding}> ",));
|
||||
}
|
||||
if preview_togglable {
|
||||
toggle_hints.push_str(&format!(" preview: <{preview_keybinding}> ",));
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ impl Television {
|
||||
|
||||
if no_help {
|
||||
config.ui.show_help_bar = false;
|
||||
config.ui.no_help = true;
|
||||
}
|
||||
|
||||
let matching_mode = if exact {
|
||||
|
Loading…
x
Reference in New Issue
Block a user