view gets its own file

pull/6/head
dvkt 5 years ago
parent 85891b87c2
commit b6e1453a5d

@ -7,6 +7,7 @@ mod help;
mod menu;
mod text;
mod ui;
mod view;
use std::process::exit;
use ui::UI;

@ -37,14 +37,6 @@ pub enum Action {
Error(String), // error message
}
pub trait View {
fn respond(&mut self, key: Key) -> Action;
fn render(&self) -> String;
fn url(&self) -> String;
fn raw(&self) -> String;
fn term_size(&mut self, cols: usize, rows: usize);
}
impl UI {
pub fn new() -> UI {
let mut size = (0, 0);

@ -0,0 +1,9 @@
use ui;
pub trait View {
fn respond(&mut self, key: ui::Key) -> ui::Action;
fn render(&self) -> String;
fn url(&self) -> String;
fn raw(&self) -> String;
fn term_size(&mut self, cols: usize, rows: usize);
}
Loading…
Cancel
Save