summaryrefslogtreecommitdiffstats
path: root/src/widget.rs
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-01-29 13:17:33 +0100
committerrabite <rabite@posteo.de>2019-01-29 13:17:33 +0100
commit3a2b02cba6bd2c74a96923354dc205ffa1758a94 (patch)
tree4a2ec21c3a538d1fab121c2862d554a8d1ae24b1 /src/widget.rs
parentefb7e9e1676d2f2f07997c04055b60b545e20916 (diff)
somewhat working miller columns
Diffstat (limited to 'src/widget.rs')
-rw-r--r--src/widget.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/widget.rs b/src/widget.rs
index 2cbdbaf..7fc319c 100644
--- a/src/widget.rs
+++ b/src/widget.rs
@@ -1,12 +1,14 @@
use termion::event::{Key, MouseEvent, Event};
+use crate::coordinates::{Coordinates, Size, Position};
+
pub trait Widget {
fn render(&self) -> Vec<String>;
- fn get_dimensions(&self) -> (u16, u16);
- fn get_position(&self) -> (u16, u16);
- fn set_dimensions(&mut self, size: (u16, u16));
- fn set_position(&mut self, position: (u16, u16));
+ fn get_size(&self) -> &Size;
+ fn get_position(&self) -> &Position;
+ fn set_size(&mut self, size: Size);
+ fn set_position(&mut self, position: Position);
fn render_header(&self) -> String;
@@ -77,5 +79,5 @@ pub trait Widget {
//fn get_buffer(&self) -> &Vec<String>;
fn refresh(&mut self);
- fn get_drawlist(&mut self) -> String;
+ fn get_drawlist(&self) -> String;
}