mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 19:45:23 +00:00
finish fixing linting errors
This commit is contained in:
parent
f1625de91d
commit
864bfc7fb7
@ -197,8 +197,7 @@ impl App {
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return self
|
self.config
|
||||||
.config
|
|
||||||
.keybindings
|
.keybindings
|
||||||
.get(&self.mode)
|
.get(&self.mode)
|
||||||
.and_then(|keymap| keymap.get(&keycode).cloned())
|
.and_then(|keymap| keymap.get(&keycode).cloned())
|
||||||
@ -206,7 +205,7 @@ impl App {
|
|||||||
Action::AddInputChar(c)
|
Action::AddInputChar(c)
|
||||||
} else {
|
} else {
|
||||||
Action::NoOp
|
Action::NoOp
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
// terminal events
|
// terminal events
|
||||||
Event::Tick => Action::Tick,
|
Event::Tick => Action::Tick,
|
||||||
|
@ -15,6 +15,7 @@ use ratatui::{backend::CrosstermBackend, layout::Size};
|
|||||||
use tokio::task::JoinHandle;
|
use tokio::task::JoinHandle;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct Tui<W>
|
pub struct Tui<W>
|
||||||
where
|
where
|
||||||
W: Write,
|
W: Write,
|
||||||
@ -24,6 +25,7 @@ where
|
|||||||
pub terminal: ratatui::Terminal<CrosstermBackend<W>>,
|
pub terminal: ratatui::Terminal<CrosstermBackend<W>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
impl<W> Tui<W>
|
impl<W> Tui<W>
|
||||||
where
|
where
|
||||||
W: Write,
|
W: Write,
|
||||||
|
@ -22,14 +22,14 @@ const DEFAULT_RESULT_NAME_FG: Color = Color::Blue;
|
|||||||
const DEFAULT_RESULT_PREVIEW_FG: Color = Color::Rgb(150, 150, 150);
|
const DEFAULT_RESULT_PREVIEW_FG: Color = Color::Rgb(150, 150, 150);
|
||||||
const DEFAULT_RESULT_LINE_NUMBER_FG: Color = Color::Yellow;
|
const DEFAULT_RESULT_LINE_NUMBER_FG: Color = Color::Yellow;
|
||||||
// input
|
// input
|
||||||
const DEFAULT_INPUT_FG: Color = Color::Rgb(200, 200, 200);
|
//const DEFAULT_INPUT_FG: Color = Color::Rgb(200, 200, 200);
|
||||||
const DEFAULT_RESULTS_COUNT_FG: Color = Color::Rgb(150, 150, 150);
|
//const DEFAULT_RESULTS_COUNT_FG: Color = Color::Rgb(150, 150, 150);
|
||||||
// preview
|
// preview
|
||||||
const DEFAULT_PREVIEW_TITLE_FG: Color = Color::Blue;
|
//const DEFAULT_PREVIEW_TITLE_FG: Color = Color::Blue;
|
||||||
const DEFAULT_SELECTED_PREVIEW_BG: Color = Color::Rgb(50, 50, 50);
|
//const DEFAULT_SELECTED_PREVIEW_BG: Color = Color::Rgb(50, 50, 50);
|
||||||
const DEFAULT_PREVIEW_CONTENT_FG: Color = Color::Rgb(150, 150, 180);
|
//const DEFAULT_PREVIEW_CONTENT_FG: Color = Color::Rgb(150, 150, 180);
|
||||||
const DEFAULT_PREVIEW_GUTTER_FG: Color = Color::Rgb(70, 70, 70);
|
//const DEFAULT_PREVIEW_GUTTER_FG: Color = Color::Rgb(70, 70, 70);
|
||||||
const DEFAULT_PREVIEW_GUTTER_SELECTED_FG: Color = Color::Rgb(255, 150, 150);
|
//const DEFAULT_PREVIEW_GUTTER_SELECTED_FG: Color = Color::Rgb(255, 150, 150);
|
||||||
|
|
||||||
pub fn get_border_style(focused: bool) -> Style {
|
pub fn get_border_style(focused: bool) -> Style {
|
||||||
if focused {
|
if focused {
|
||||||
|
@ -40,6 +40,7 @@ pub fn to_input_request(evt: &CrosstermEvent) -> Option<InputRequest> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
/// Import this trait to implement `Input::handle_event()` for crossterm.
|
/// Import this trait to implement `Input::handle_event()` for crossterm.
|
||||||
pub trait EventHandler {
|
pub trait EventHandler {
|
||||||
/// Handle crossterm event.
|
/// Handle crossterm event.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user