mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
21 lines
493 B
Rust
21 lines
493 B
Rust
use crossterm::terminal::WindowSize;
|
|
use ratatui::layout::Rect;
|
|
use yazi_shared::{event::Cmd, term::Term};
|
|
|
|
use crate::{app::App, notify};
|
|
|
|
impl App {
|
|
pub(crate) fn update_notify(&mut self, cmd: Cmd) {
|
|
let WindowSize { rows, columns, .. } = Term::size();
|
|
let area =
|
|
notify::Layout::available(Rect { x: 0, y: 0, width: columns, height: rows });
|
|
|
|
self.cx.notify.tick(cmd, area);
|
|
|
|
if self.cx.notify.messages.is_empty() {
|
|
self.render();
|
|
} else {
|
|
self.render_notify();
|
|
}
|
|
}
|
|
}
|