Skip to content

Commit

Permalink
cool stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski committed Dec 4, 2024
1 parent cdeb7e0 commit a4ef503
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use anyhow::Result;
use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyEventKind};
use nvrs::*;
use ratatui::{
layout::Alignment,
widgets::{Block, BorderType, List, ListItem},
Frame,
layout::Alignment, style::{Style, Stylize}, widgets::{Block, BorderType, List, ListItem}, Frame
};
use tachyonfx::{fx, Duration as FxDuration, Effect, EffectRenderer, Shader};

const KEYBINDS: &str = " [q] Quit [s] Sync ";

struct AppState {
is_running: bool,
is_syncing: bool,
Expand Down Expand Up @@ -42,13 +42,14 @@ impl AppState {
fn draw(&mut self, frame: &mut Frame) {
let new_names = self.verfiles.1.data.data.keys().collect::<Vec<_>>();

let list = List::new(new_names.iter().map(|p| ListItem::new(p.to_string()))).block(
let list = List::new(new_names.iter().map(|p| ListItem::new(format!("📦️ {}", p)).style(Style::default().blue()))).block(
Block::bordered()
.title(if self.is_syncing {
.title_top(if self.is_syncing {
" Synchronizing... "
} else {
" nvrs "
})
.title_bottom(KEYBINDS)
.title_alignment(Alignment::Center)
.border_type(BorderType::Rounded),
);
Expand Down

0 comments on commit a4ef503

Please sign in to comment.