ommp.git

ommp

~ Oh My Music Player — a standalone terminal music player built with Rust and ratatui
git clone https://github.com/debuman/ommp.git

src/ui/pane.rs (544B)

      1 use crossterm::event::{KeyEvent, MouseEvent};
      2 use ratatui::Frame;
      3 use ratatui::layout::Rect;
      4 
      5 use crate::app::{App, AppAction};
      6 use crate::ui::theme::Theme;
      7 
      8 pub trait Pane {
      9     fn render(&mut self, frame: &mut Frame, area: Rect, focused: bool, app: &App, theme: &Theme);
     10     fn handle_key(&mut self, key: KeyEvent, app: &App) -> Option<AppAction>;
     11     fn handle_mouse(&mut self, event: MouseEvent, area: Rect, app: &App) -> Option<AppAction>;
     12     fn handle_scroll(&mut self, _up: bool, _app: &App) -> Option<AppAction> {
     13         None
     14     }
     15 }