#[cfg(feature = "gui")]
use ratatui::style::{Color, Modifier, Style};
#[cfg(feature = "gui")]
pub trait CanvasTheme {
fn background(&self) -> Style;
fn label(&self) -> Style;
fn label_active(&self) -> Style;
fn input(&self) -> Style;
fn input_active(&self) -> Style;
fn selection(&self) -> Style;
fn cursorline(&self) -> Style;
fn completion(&self) -> Style;
fn cursor_normal(&self) -> Style;
fn cursor_insert(&self) -> Style;
fn cursor_select(&self) -> Style;
fn suggestions(&self) -> Style;
fn suggestion_selected(&self) -> Style;
fn warning(&self) -> Style;
fn border(&self) -> Style;
fn border_active(&self) -> Style;
}
#[cfg(feature = "gui")]
#[derive(Debug, Clone, Default)]
pub struct DefaultCanvasTheme;
#[cfg(feature = "gui")]
impl CanvasTheme for DefaultCanvasTheme {
fn background(&self) -> Style {
Style::default().bg(Color::Black)
}
fn label(&self) -> Style {
Style::default().fg(Color::White)
}
fn label_active(&self) -> Style {
Style::default().fg(Color::Yellow)
}
fn input(&self) -> Style {
Style::default().fg(Color::White)
}
fn input_active(&self) -> Style {
Style::default().fg(Color::White)
}
fn selection(&self) -> Style {
Style::default()
.fg(Color::Yellow)
.bg(Color::Blue)
.add_modifier(Modifier::BOLD)
}
fn cursorline(&self) -> Style {
Style::default().bg(Color::DarkGray)
}
fn completion(&self) -> Style {
Style::default().fg(Color::DarkGray)
}
fn cursor_normal(&self) -> Style {
Style::default().fg(Color::Black).bg(Color::White)
}
fn cursor_insert(&self) -> Style {
Style::default().fg(Color::Black).bg(Color::Green)
}
fn cursor_select(&self) -> Style {
Style::default().fg(Color::Black).bg(Color::Blue)
}
fn suggestions(&self) -> Style {
Style::default().fg(Color::White).bg(Color::Black)
}
fn suggestion_selected(&self) -> Style {
Style::default()
.fg(Color::Black)
.bg(Color::Yellow)
.add_modifier(Modifier::BOLD)
}
fn warning(&self) -> Style {
Style::default().fg(Color::Red)
}
fn border(&self) -> Style {
Style::default().fg(Color::DarkGray)
}
fn border_active(&self) -> Style {
Style::default().fg(Color::Cyan)
}
}