diff options
Diffstat (limited to 'src/tuicursor.rs')
| -rw-r--r-- | src/tuicursor.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tuicursor.rs b/src/tuicursor.rs new file mode 100644 index 0000000..fbb7531 --- /dev/null +++ b/src/tuicursor.rs @@ -0,0 +1,15 @@ +use ratatui::{crossterm::cursor::SetCursorStyle, layout::Rect}; + +pub struct TuiCursor { + pub position: (u16, u16), + pub style: SetCursorStyle, +} + +impl TuiCursor { + pub fn relative_to(self, rect: Rect) -> Self { + Self { + position: (rect.y + self.position.0, rect.x + self.position.1), + style: self.style, + } + } +} |