refactor: use THEME for all colors, add theme fields, fix forge installer

This commit is contained in:
objz committed 2025-10-04 19:15:38 +02:00
1 parent eeb4333b94
commit d4ffcca61c
12 files changed
+139 -41

No files matched your search

+5 -5
View File
@@ -1,7 +1,7 @@
use ratatui::{
buffer::Buffer,
layout::Rect,
style::{Color, Modifier, Style},
style::{Modifier, Style},
text::{Line, Span},
widgets::{Paragraph, Widget, Wrap},
};
@@ -24,15 +24,15 @@ impl ErrorPopup {
impl Widget for ErrorPopup {
fn render(self, area: Rect, buf: &mut Buffer) {
let (border_color, label) = match self.event.level {
Level::ERROR => (Color::Red, "ERROR"),
Level::WARN => (Color::Yellow, "WARN"),
Level::ERROR => (THEME.colors.error, "ERROR"),
Level::WARN => (THEME.colors.warn, "WARN"),
_ => (THEME.colors.border_focused, "INFO"),
};
let title = Line::from(vec![Span::styled(
format!(" {} ", label),
Style::default()
.fg(Color::Black)
.fg(THEME.colors.badge_text)
.bg(border_color)
.add_modifier(Modifier::BOLD),
)]);
@@ -41,7 +41,7 @@ impl Widget for ErrorPopup {
let popup = PopupFrame {
title,
border_color,
bg: None,
bg: Some(THEME.colors.popup_bg),
keybinds: None,
search_line: None,
content: Box::new(move |inner, buf| {
+3 -3
View File
@@ -152,7 +152,7 @@ pub fn render(frame: &mut Frame, area: Rect, _focused: FocusedArea) {
let popup = PopupFrame {
title: wizard_title(&snapshot),
border_color: THEME.colors.border_focused,
bg: None,
bg: Some(THEME.colors.popup_bg),
keybinds: Some(keybinds),
search_line,
content: Box::new(move |popup_area, buf| {
@@ -511,7 +511,7 @@ fn render_version_step(state: &WizardState, area: Rect, buf: &mut ratatui::buffe
LoadState::Error(message) => {
Paragraph::new(message.as_str())
.wrap(Wrap { trim: true })
.style(Style::default().fg(ratatui::style::Color::Red))
.style(Style::default().fg(THEME.colors.error))
.render(area, buf);
}
LoadState::Loaded(_) => {
@@ -588,7 +588,7 @@ fn render_loader_version_step(
LoadState::Error(message) => {
Paragraph::new(message.as_str())
.wrap(Wrap { trim: true })
.style(Style::default().fg(ratatui::style::Color::Red))
.style(Style::default().fg(THEME.colors.error))
.render(area, buf);
}
LoadState::Loaded(versions) => {