mirror of
https://github.com/forkless/NotAlterra.git
synced 2026-08-21 10:28:59 +02:00
Fix OK dialog width padding to avoid text clipping
This commit is contained in:
+1
-1
@@ -220,7 +220,7 @@ pub fn draw_confirm_popup(
|
||||
}
|
||||
|
||||
pub fn draw_ok_dialog(f: &mut Frame, _app: &AppState, title: &str, message: &str) {
|
||||
let content_w = message.lines().map(|l| l.len()).max().unwrap_or(20).max(title.len()) as u16 + 6;
|
||||
let content_w = message.lines().map(|l| l.len()).max().unwrap_or(20).max(title.len()) as u16 + 10;
|
||||
let popup_w = content_w.max(50).min(f.area().width.saturating_sub(4));
|
||||
let popup_h = (message.lines().count() as u16 + 7).min(f.area().height.saturating_sub(4));
|
||||
let area = centered_rect_size(popup_w, popup_h, f.area());
|
||||
|
||||
Reference in New Issue
Block a user