This commit is contained in:
@@ -13,21 +13,24 @@ use std::io::stdout;
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
eprintln!("TUI started");
|
||||
enable_raw_mode()?;
|
||||
eprintln!("raw mode enabled");
|
||||
let (width, height) = match crossterm::terminal::size() {
|
||||
Ok((w, h)) if w > 0 && h > 0 => (w, h),
|
||||
_ => (80, 24),
|
||||
};
|
||||
println!("Width: {}, Height: {}", width, height);
|
||||
let use_alternate_screen = true;
|
||||
let use_alternate_screen = false;
|
||||
let mut stdout = stdout();
|
||||
if use_alternate_screen {
|
||||
execute!(stdout, EnterAlternateScreen)?;
|
||||
}
|
||||
let backend = CrosstermBackend::new(stdout);
|
||||
let mut terminal = Terminal::new(backend)?;
|
||||
eprintln!("terminal created");
|
||||
|
||||
let mut app = app::App::new();
|
||||
let mut blink_counter = 0;
|
||||
eprintln!("entering loop");
|
||||
|
||||
loop {
|
||||
let blink = (blink_counter / 3) % 2 == 0;
|
||||
|
||||
20
src/theme.rs
20
src/theme.rs
@@ -17,16 +17,16 @@ pub struct Theme {
|
||||
impl Theme {
|
||||
pub fn gruvbox_dark() -> Self {
|
||||
Self {
|
||||
bg: Color::Rgb(40, 40, 40),
|
||||
fg: Color::Rgb(235, 219, 178),
|
||||
red: Color::Rgb(204, 36, 29),
|
||||
green: Color::Rgb(152, 151, 26),
|
||||
yellow: Color::Rgb(215, 153, 33),
|
||||
blue: Color::Rgb(69, 133, 136),
|
||||
purple: Color::Rgb(177, 98, 134),
|
||||
aqua: Color::Rgb(104, 157, 106),
|
||||
orange: Color::Rgb(214, 93, 14),
|
||||
gray: Color::Rgb(146, 131, 116),
|
||||
bg: Color::Black,
|
||||
fg: Color::White,
|
||||
red: Color::Red,
|
||||
green: Color::Green,
|
||||
yellow: Color::Yellow,
|
||||
blue: Color::Blue,
|
||||
purple: Color::Magenta,
|
||||
aqua: Color::Cyan,
|
||||
orange: Color::Yellow,
|
||||
gray: Color::Gray,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ use ratatui::{
|
||||
use crate::app::App;
|
||||
|
||||
pub fn draw(f: &mut Frame, app: &App, blink: bool) {
|
||||
// let bg_block = Block::default().style(Style::default().bg(app.theme.bg));
|
||||
// f.render_widget(bg_block, f.size());
|
||||
let bg_block = Block::default().style(Style::default().bg(app.theme.bg));
|
||||
f.render_widget(bg_block, f.size());
|
||||
|
||||
if app.show_welcome {
|
||||
let fg = app.theme.fg;
|
||||
|
||||
Reference in New Issue
Block a user