fix(tui): render wrapped keybind footers

This commit is contained in:
objz committed 2026-07-27 00:37:14 +02:00
1 parent d123bb5c19
commit 1de0c7e139
6 files changed
+64 -25

No files matched your search

+9 -6
View File
@@ -210,7 +210,7 @@ pub fn render(
.border_type(BORDER_STYLE.to_border_type())
.border_style(Style::default().fg(color));
if focused == FocusedArea::Settings {
let keybind_lines = if focused == FocusedArea::Settings {
let keybinds: &[(&str, &str)] = match state.pane {
SettingsPane::Profile => &[
("⏎", " select"),
@@ -226,14 +226,17 @@ pub fn render(
("h/l", " tab"),
],
};
let lines = super::popups::keybind_lines_wrapped(keybinds, area.width.saturating_sub(2));
for line in lines {
block = block.title_bottom(line);
}
super::popups::keybind_lines_wrapped(keybinds, area.width.saturating_sub(2))
} else {
Vec::new()
};
if let Some(line) = keybind_lines.last() {
block = block.title_bottom(line.clone());
}
let inner = block.inner(area);
let mut inner = block.inner(area);
frame.render_widget(block, area);
inner = super::popups::render_keybind_overflow(frame, inner, &keybind_lines);
if inner.width >= 42 {
let chunks = Layout::default()