working frontend, now changing color nonsense
This commit is contained in:
23
src/client/components/command_line.rs
Normal file
23
src/client/components/command_line.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
// src/client/components/command_line.rs
|
||||
use ratatui::{
|
||||
widgets::{Block, Paragraph},
|
||||
style::Style,
|
||||
layout::Rect,
|
||||
Frame,
|
||||
};
|
||||
use crate::client::colors::PastelGrayTheme;
|
||||
|
||||
pub fn render_command_line(f: &mut Frame, area: Rect, input: &str, active: bool) {
|
||||
let prompt = if active { ":" } else { "Press ':' for commands" };
|
||||
let style = if active {
|
||||
Style::default().fg(DoomColors::CYAN)
|
||||
} else {
|
||||
Style::default().fg(DoomColors::HL)
|
||||
};
|
||||
|
||||
let paragraph = Paragraph::new(format!("{}{}", prompt, input))
|
||||
.block(Block::default().style(Style::default().bg(DoomColors::BG)))
|
||||
.style(style);
|
||||
|
||||
f.render_widget(paragraph, area);
|
||||
}
|
||||
Reference in New Issue
Block a user