diff --git a/yazi-config/preset/theme.toml b/yazi-config/preset/theme.toml index c1965186..c5d8d0b6 100644 --- a/yazi-config/preset/theme.toml +++ b/yazi-config/preset/theme.toml @@ -335,4 +335,20 @@ rules = [ { name = "*/", text = "" }, ] + +# : }}} + + +# : Notify {{{ + +[notify] +title_info = { fg = "green" } +title_warn = { bg = "yellow" } +title_error = { fg = "red" } + +# Icons +icon_info = "" +icon_warn = "" +icon_error = "" + # : }}} diff --git a/yazi-fm/src/notify/layout.rs b/yazi-fm/src/notify/layout.rs index b2b8acd9..6ef57de1 100644 --- a/yazi-fm/src/notify/layout.rs +++ b/yazi-fm/src/notify/layout.rs @@ -1,6 +1,7 @@ use std::rc::Rc; -use ratatui::{buffer::Buffer, layout::{self, Constraint, Offset, Rect}, style::{Style, Stylize}, widgets::{Block, BorderType, Paragraph, Widget, Wrap}}; +use ratatui::{buffer::Buffer, layout::{self, Constraint, Offset, Rect}, widgets::{Block, BorderType, Paragraph, Widget, Wrap}}; +use yazi_config::THEME; use yazi_core::notify::{Level, Message}; use crate::{widgets::Clear, Ctx}; @@ -42,9 +43,9 @@ impl<'a> Widget for Layout<'a> { for (i, m) in notify.messages.iter().enumerate().take(limit) { let (icon, style) = match m.level { - Level::Info => ("", Style::default().green()), - Level::Warn => ("", Style::default().yellow()), - Level::Error => ("", Style::default().red()), + Level::Info => (&THEME.notify.icon_info, THEME.notify.title_info), + Level::Warn => (&THEME.notify.icon_warn, THEME.notify.title_warn), + Level::Error => (&THEME.notify.icon_error, THEME.notify.title_error), }; let mut rect =