fix(tui): keep keybind footers on one line
This commit is contained in:
1 parent
63b4adaca8
commit
59707b77d2
7 files changed
+48
-109
No files matched your search
+2
-2
@@ -25,8 +25,8 @@ expression: ui.screen()
|
||||
"│ ││ │"
|
||||
"│ ││ │"
|
||||
"│ ││ │"
|
||||
"│ ││[l] launch [⏎] content [Shift+⏎] open dir [Esc] kill [a] add [m] modpacks│"
|
||||
"│ │╰────────────────────────────────[u] update [d] delete [r] rename [/] search╯"
|
||||
"│ ││ │"
|
||||
"│ │╰[l] launch [⏎] content [Shift+⏎] open dir [Esc] kill [a] add [m] modpacks╯"
|
||||
"│ │╭Accounts─────────╮╭Settings───────────────────────────╮╭Overview──────────────╮"
|
||||
"│ ││No accounts. ││▸ instance default ││Ready │"
|
||||
"│ ││ ││ ││ │"
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ expression: ui.screen()
|
||||
"│ ││ │"
|
||||
"│ ││ │"
|
||||
"│ ││ │"
|
||||
"│ ││[l] launch [⏎] content [Shift+⏎] open dir [Esc] kill [a] add [m] modpacks│"
|
||||
"│ │╰────────────────────────────────[u] update [d] delete [r] rename [/] search╯"
|
||||
"│ ││ │"
|
||||
"│ │╰[l] launch [⏎] content [Shift+⏎] open dir [Esc] kill [a] add [m] modpacks╯"
|
||||
"│ │╭Accounts─────────╮╭Settings───────────────────────────╮╭Overview──────────────╮"
|
||||
"│ ││No accounts. ││▸ instance default ││Ready │"
|
||||
"│ ││ ││ ││ │"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use super::{
|
||||
confirm::{ConfirmTarget, confirm_popup_area},
|
||||
keybind_lines_wrapped, word_wrap_size,
|
||||
keybind_line_fitted, word_wrap_size,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn keybind_wrapping_uses_terminal_width_for_unicode_keys() {
|
||||
let lines = keybind_lines_wrapped(&[("⏎", " select"), ("a", " add")], 19);
|
||||
fn fitted_keybinds_use_terminal_width_and_omit_overflow() {
|
||||
let line = keybind_line_fitted(&[("⏎", " select"), ("a", " add")], 10);
|
||||
|
||||
assert_eq!(lines.len(), 1);
|
||||
assert_eq!(lines[0].width(), 19);
|
||||
assert_eq!(line.width(), 10);
|
||||
assert_eq!(line.to_string(), "[⏎] select");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user