diff options
| author | lukeflo | 2024-10-25 12:48:19 +0200 |
|---|---|---|
| committer | lukeflo | 2024-10-25 12:48:19 +0200 |
| commit | 23ee04fffe4bdf4b8c34603e4b191d7cc308051b (patch) | |
| tree | 70e4b146e388067dec7e4d5d1c5b8cd3628b5e4a /src/tui/ui.rs | |
| parent | bc4513d700b724b8edb72b6a1a429df60967a12c (diff) | |
| download | bibiman-23ee04fffe4bdf4b8c34603e4b191d7cc308051b.tar.gz bibiman-23ee04fffe4bdf4b8c34603e4b191d7cc308051b.zip | |
Inegrate new command-action driven structure
- Map keys to actions to commands
- allows for easily adding config file support
- restructure folders/files
- implement own input mode
- rewrite UI rendering to make it better editable
Diffstat (limited to 'src/tui/ui.rs')
| -rw-r--r-- | src/tui/ui.rs | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/tui/ui.rs b/src/tui/ui.rs index 9e561c3..507177b 100644 --- a/src/tui/ui.rs +++ b/src/tui/ui.rs @@ -32,7 +32,6 @@ use ratatui::{ ScrollbarOrientation, Table, Wrap, }, }; -use tui_input::Input; const MAIN_BLUE_COLOR: Color = Color::Indexed(39); // const MAIN_PURPLE_COLOR: Color = Color::Indexed(129); @@ -99,14 +98,6 @@ pub fn render_ui(app: &mut App, frame: &mut Frame) { render_entrytable(app, frame, entry_area); render_selected_item(app, frame, info_area); render_taglist(app, frame, tag_area); - // Bibiman::render_header(header_area, buf); - // self.bibiman.render_footer(footer_area, buf); - // Render list area where entry gets selected - // self.bibiman.render_entrytable(entry_area, buf); - // self.bibiman.render_file_info(entry_info_area, buf); - // Render infos related to selected entry - // self.bibiman.render_taglist(tag_area, buf); - // self.bibiman.render_selected_item(info_area, buf); } pub fn render_header(frame: &mut Frame, rect: Rect) { @@ -141,11 +132,13 @@ pub fn render_footer(app: &mut App, frame: &mut Frame, rect: Rect) { .title(Line::styled(search_title, BOX_SELECTED_TITLE_STYLE)) .border_style(BOX_SELECTED_BOX_STYLE) .border_set(symbols::border::THICK); + render_cursor(app, frame, rect); frame.render_widget( - Paragraph::new(app.bibiman.search_struct.search_string.clone()).block(block), + Paragraph::new(app.bibiman.search_struct.search_string.clone()) + .block(block) + .fg(TEXT_FG_COLOR), rect, ); - render_cursor(app, frame, rect); } _ => { let style_emph = Style::new().bold().fg(TEXT_FG_COLOR); @@ -244,13 +237,28 @@ pub fn render_file_info(app: &mut App, frame: &mut Frame, rect: Rect) { { vec