fix(tui): fit confirmation popups to content
This commit is contained in:
1 parent
992f15b082
commit
6527b24081
6 files changed
+31
-3
No files matched your search
@@ -618,7 +618,9 @@ fn render_version_popup(frame: &mut Frame, area: Rect, state: &DiscoveryState) {
|
||||
};
|
||||
let popup_area = area.centered(
|
||||
Constraint::Percentage(50),
|
||||
Constraint::Length(VERSION_POPUP_HEIGHT.min(area.height.saturating_sub(2))),
|
||||
Constraint::Length(
|
||||
version_popup_height(popup.confirming).min(area.height.saturating_sub(2)),
|
||||
),
|
||||
);
|
||||
let theme = THEME.as_ref();
|
||||
let title = popup.title();
|
||||
@@ -727,6 +729,10 @@ fn render_version_popup(frame: &mut Frame, area: Rect, state: &DiscoveryState) {
|
||||
frame.render_widget(popup, popup_area);
|
||||
}
|
||||
|
||||
fn version_popup_height(confirming: bool) -> u16 {
|
||||
if confirming { 6 } else { VERSION_POPUP_HEIGHT }
|
||||
}
|
||||
|
||||
fn confirmation_values(values: &[String]) -> String {
|
||||
if values.is_empty() {
|
||||
"Unknown".to_owned()
|
||||
|
||||
Reference in new issue
Block a user