This commit is contained in:
@@ -12,11 +12,10 @@ use std::io::stdout;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
enable_raw_mode()?;
|
||||
let (mut width, mut height) = crossterm::terminal::size()?;
|
||||
if width == 0 || height == 0 {
|
||||
width = 80;
|
||||
height = 24;
|
||||
}
|
||||
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 =
|
||||
std::env::var("SSH_CLIENT").is_err() && std::env::var("SSH_TTY").is_err();
|
||||
|
||||
@@ -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;
|
||||
@@ -102,7 +102,7 @@ pub fn draw(f: &mut Frame, app: &App, blink: bool) {
|
||||
}
|
||||
|
||||
let help_text = Paragraph::new("Use hjkl or arrows to navigate, ? for help, q to quit")
|
||||
.style(Style::default().fg(app.theme.fg).bg(app.theme.bg));
|
||||
.style(Style::default().fg(app.theme.fg));
|
||||
f.render_widget(help_text, chunks[1]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user