diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-04-20 11:19:34 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-04-20 11:20:34 -0400 |
commit | 763815418ac3acd56aa7e936c48861ae6e73ca40 (patch) | |
tree | f8213b7ffaf588dc49ad83f502b5db42f2c435e2 /src/ui | |
parent | d78e36a0648f580ad950e6dc26b886de7fed180b (diff) |
add H, L and M vim actions
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/mod.rs | 30 | ||||
-rw-r--r-- | src/ui/preview_area.rs | 18 | ||||
-rw-r--r-- | src/ui/rect.rs | 7 |
3 files changed, 30 insertions, 25 deletions
diff --git a/src/ui/mod.rs b/src/ui/mod.rs index c71feb6..2b19584 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -1,30 +1,10 @@ -use std::path; - +mod preview_area; +mod rect; mod tui_backend; + pub mod views; pub mod widgets; +pub use preview_area::*; +pub use rect::*; pub use tui_backend::*; - -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)] -pub struct Rect { - pub x: u16, - pub y: u16, - pub width: u16, - pub height: u16, -} - -#[derive(Debug, Clone)] -pub struct PreviewArea { - pub file_preview_path: path::PathBuf, - pub preview_area: Rect, -} - -impl PreviewArea { - pub fn new(file_preview_path: path::PathBuf, preview_area: Rect) -> Self { - Self { - file_preview_path, - preview_area, - } - } -} diff --git a/src/ui/preview_area.rs b/src/ui/preview_area.rs new file mode 100644 index 0000000..faf0269 --- /dev/null +++ b/src/ui/preview_area.rs @@ -0,0 +1,18 @@ +use std::path; + +use super::Rect; + +#[derive(Debug, Clone)] +pub struct PreviewArea { + pub file_preview_path: path::PathBuf, + pub preview_area: Rect, +} + +impl PreviewArea { + pub fn new(file_preview_path: path::PathBuf, preview_area: Rect) -> Self { + Self { + file_preview_path, + preview_area, + } + } +} diff --git a/src/ui/rect.rs b/src/ui/rect.rs new file mode 100644 index 0000000..32d317c --- /dev/null +++ b/src/ui/rect.rs @@ -0,0 +1,7 @@ +#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)] +pub struct Rect { + pub x: u16, + pub y: u16, + pub width: u16, + pub height: u16, +} |