themes
This commit is contained in:
parent
01774cb9c2
commit
5c6ced8ca0
4 changed files with 69 additions and 21 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use itertools::Itertools;
|
||||
use ratatui_themes::{Theme, ThemeName};
|
||||
use serde_json::de;
|
||||
use std::{
|
||||
fs::{self, DirEntry},
|
||||
io,
|
||||
|
|
@ -23,7 +24,7 @@ use ratatui::{
|
|||
crossterm::event::{self, Event, KeyCode, KeyModifiers},
|
||||
layout::{Constraint, HorizontalAlignment, Layout, Rect},
|
||||
style::Style,
|
||||
text::{Span, Text},
|
||||
text::{Line, Span, Text},
|
||||
widgets::{
|
||||
Block, Clear, List, ListItem, ListState, Padding, Paragraph, StatefulWidget, Widget, Wrap,
|
||||
},
|
||||
|
|
@ -35,9 +36,9 @@ pub mod model;
|
|||
pub mod processing;
|
||||
pub mod reader;
|
||||
|
||||
pub fn run(logs_dir: PathBuf, compiler_root: Option<PathBuf>) {
|
||||
pub fn run(logs_dir: PathBuf, compiler_root: Option<PathBuf>, theme: ThemeName) {
|
||||
let terminal = ratatui::init();
|
||||
let theme = Theme::new(ThemeName::OneDarkPro);
|
||||
let theme = Theme::new(theme);
|
||||
let app_result = App::new(logs_dir, compiler_root, theme).run(terminal);
|
||||
ratatui::restore();
|
||||
|
||||
|
|
@ -458,12 +459,13 @@ impl Widget for &mut App {
|
|||
{
|
||||
let full_file_path = canonical_rustc_root.join(&file);
|
||||
Hyperlink::new(
|
||||
format!("In file: {}", file.display()),
|
||||
Line::from(format!("In file: {}", file.display())).style(default),
|
||||
format!("file://{}:{line}", full_file_path.display()),
|
||||
)
|
||||
.render(first_line, buf);
|
||||
} else {
|
||||
Span::from(format!("In file: {}:{line}", file.display()))
|
||||
Line::from(format!("In file: {}:{line}", file.display()))
|
||||
.style(default)
|
||||
.render(first_line, buf);
|
||||
}
|
||||
}
|
||||
|
|
@ -489,7 +491,7 @@ impl Widget for &mut App {
|
|||
(res, height)
|
||||
});
|
||||
|
||||
let list = ListView::new(builder, items.len());
|
||||
let list = ListView::new(builder, items.len()).style(default);
|
||||
StatefulWidget::render(list, footer_area, buf, &mut lv.footer_list);
|
||||
}
|
||||
Tab::Empty => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue