Remove PopupView Trait

This commit is contained in:
RainBus
2024-10-17 23:22:43 +08:00
parent c79e17a06f
commit ca05dfd3da
2 changed files with 8 additions and 7 deletions

View File

@@ -1,9 +1,11 @@
use std::io;
use ratatui::layout::{Constraint, Layout, Rect};
use super::{
center_rect,
component::{list::ListComponent, Component},
PopupView,
View,
};
pub struct SettingView {
@@ -22,7 +24,7 @@ impl Default for SettingView {
}
}
impl PopupView for SettingView {
impl View for SettingView {
fn draw(&self, frame: &mut ratatui::Frame) {
let area = center_rect(frame.area(), self.area.width, self.area.height);
let layout = Layout::default()
@@ -31,5 +33,7 @@ impl PopupView for SettingView {
frame.render_widget(self.menu.widget(), layout[0]);
}
fn handle_event(&mut self, _event: &crossterm::event::Event) {}
fn handle_event(&mut self, _event: &crossterm::event::Event) -> io::Result<()> {
Ok(())
}
}