Fixing color schemes

This commit is contained in:
2026-01-30 20:15:43 +01:00
parent 44d1e9af24
commit eb3969b952
22 changed files with 2888 additions and 482 deletions

View File

@@ -1,4 +1,4 @@
use crate::theme::ui;
use crate::theme;
use ratatui::layout::Rect;
use ratatui::style::{Color, Style};
use ratatui::widgets::{Block, Borders, Clear, Paragraph};
@@ -8,7 +8,7 @@ pub struct ModalFrame<'a> {
title: &'a str,
width: u16,
height: u16,
border_color: Color,
border_color: Option<Color>,
}
impl<'a> ModalFrame<'a> {
@@ -17,7 +17,7 @@ impl<'a> ModalFrame<'a> {
title,
width: 40,
height: 5,
border_color: ui::TEXT_PRIMARY,
border_color: None,
}
}
@@ -32,11 +32,12 @@ impl<'a> ModalFrame<'a> {
}
pub fn border_color(mut self, c: Color) -> Self {
self.border_color = c;
self.border_color = Some(c);
self
}
pub fn render_centered(&self, frame: &mut Frame, term: Rect) -> Rect {
let t = theme::get();
let width = self.width.min(term.width.saturating_sub(4));
let height = self.height.min(term.height.saturating_sub(4));
@@ -51,15 +52,16 @@ impl<'a> ModalFrame<'a> {
for row in 0..area.height {
let line_area = Rect::new(area.x, area.y + row, area.width, 1);
frame.render_widget(
Paragraph::new(bg_fill.clone()).style(Style::new().bg(ui::BG)),
Paragraph::new(bg_fill.clone()).style(Style::new().bg(t.ui.bg)),
line_area,
);
}
let border_color = self.border_color.unwrap_or(t.ui.text_primary);
let block = Block::default()
.borders(Borders::ALL)
.title(self.title)
.border_style(Style::new().fg(self.border_color));
.border_style(Style::new().fg(border_color));
let inner = block.inner(area);
frame.render_widget(block, area);