mirror of
https://github.com/nachoparker/dutree
synced 2024-05-12 23:56:08 +02:00
Use a minimum of 25 columns for filenames
On an 80 column terminal, which is a quite common configuration, the filename column was too cramped for even moderate filenames and depths. Use a minimum of 25 columns for the filename column, but after that let it scale with the size of the window to provide as before.
This commit is contained in:
parent
fc5f93a72d
commit
cba18d82ad
|
@ -397,9 +397,9 @@ impl<'a> Entry<'a> {
|
|||
eprintln!("Unable to get terminal size");
|
||||
}
|
||||
let size_width = 15;
|
||||
let var_width = twidth - size_width;
|
||||
let bar_width = var_width as usize * 75 / 100;
|
||||
let tree_name_width = var_width as usize * 25 / 100;
|
||||
let var_width = (twidth - size_width) as usize;
|
||||
let tree_name_width = 25.max(var_width * 25 / 100);
|
||||
let bar_width = var_width - tree_name_width;
|
||||
|
||||
// initalize
|
||||
let open_parents : Vec<bool> = Vec::new();
|
||||
|
|
Loading…
Reference in New Issue