feat(tui): improve tab navigation
This commit is contained in:
1 parent
6c92c6132a
commit
09d548272b
7 files changed
+224
-94
No files matched your search
@@ -39,13 +39,6 @@ pub fn word_wrap_size(text: &str, max_inner_width: usize) -> (usize, usize) {
|
||||
(widest_line, lines)
|
||||
}
|
||||
|
||||
pub fn centered_rect(frame: Rect, inner_w: usize, inner_h: usize) -> Rect {
|
||||
let popup_w = ((inner_w + 2) as u16).min(frame.width.saturating_sub(4));
|
||||
let popup_h = ((inner_h + 2) as u16).min(frame.height.saturating_sub(4));
|
||||
use ratatui::layout::Constraint;
|
||||
frame.centered(Constraint::Length(popup_w), Constraint::Length(popup_h))
|
||||
}
|
||||
|
||||
pub fn top_right_rect(frame: Rect, inner_w: usize, inner_h: usize) -> Rect {
|
||||
let popup_w = (inner_w + 2) as u16;
|
||||
let popup_h = (inner_h + 2) as u16;
|
||||
|
||||
Reference in new issue
Block a user