fix(algorithm): formalize small files and unrenderable tiles behaviour

This commit is contained in:
Aram Drevekenin
2020-04-30 17:54:36 +02:00
parent c01e2ae8f0
commit a8c79c2425
9 changed files with 368 additions and 218 deletions

View File

@@ -6,27 +6,27 @@ expression: "&terminal_draw_events_mirror[1]"
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG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GGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG

View File

@@ -3,9 +3,9 @@ source: src/tests/cases/ui.rs
expression: "&terminal_draw_events_mirror[0]"
---
┌────────────────────────────────────────────────────────────────┐┌──────────────────────┐
/tmp/bandwhich_tests/cannot_move_into_small_files (2.5M) │ /tmp/bandwhich_tests/cannot_move_into_small_files (2.5M) ││ Space freed: 0 │
/tmp/bandwhich_tests/cannot_move_into_small_files (2.4M) │ /tmp/bandwhich_tests/cannot_move_into_small_files (2.4M) ││ Space freed: 0 │
└────────────────────────────────────────────────────────────────┘└──────────────────────┘
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │ │
│ │ │
│ │ │
@@ -23,11 +23,11 @@ expression: "&terminal_draw_events_mirror[0]"
│ │ │
│ │ │
│ │ │
│ │ │
│ │ file1 │
│ │ │
│ │ │
│ │ 401.4K (16%) │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │
│ │ │
│ │ │
│ │ │
@@ -44,12 +44,12 @@ expression: "&terminal_draw_events_mirror[0]"
│ │ │
│ │ │
│ │ │
├──────────────────────────────────┤
│xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
│ │xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
│ │xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
│ │xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
│ │
├─────────────────────────────────┤
│xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
│xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
│xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx│
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
x = Small files
<hjkl> or <arrow keys> - move around, <ENTER> - enter folder, <ESC> - parent folder, <Ctrl-D> - delete

View File

@@ -24,32 +24,32 @@ expression: "&terminal_draw_events_mirror[0]"
│ │ │ │
│ │ │ │
│ 135.2K (12%) │ │ │
│ ├─────────────────────────────────────┬───────────┴─┬───────┬───────┬────────┬───────┬───────┬───────┤
│ │ │medium_file0 │file16 file17 file18 file19 │ file2 │file20
│ │ │ │ │ │ │ │ │ │
├───────────────────────────────────────────────────────────────────────────────────────┤ │ 8.2K (1%) │ 4.1K │ 4.1K │ 4.1K │ 4.1K │ 4.1K4.1K
│ │ ├─────────────┼───────┼───────┼────────┼───────┼───────┼───────┤
│ │ │medium_file1 │file21 │file22 │ file23 │file24 │file25 │file26 │
│ │ │ │ 4.1K │ 4.1K │ 4.1K │ 4.1K │ 4.1K │ 4.1K
│ big_file2 │ │ 8.2K (1%) ├───────────┬──────────────┬─┴──────┬┴───────┤
│ │ ├─────────────┤ file27 │ file34 file35 file36 │ file37
│ │ │ file0 ├────────────┤ 4.1K │ 4.1K │ 4.1K │ 4.1K │
│ 135.2K (12%) │ ├─────────────┤ file28 ├────────────────┼────────┼────────┤
│ │ big_file6 │ file1 │ 4.1K (0%) │ file38 │ file39 │ file4 │ file40
│ │ ├─────────────┼────────────┤ │ │ │ │
│ │ │ file10 │ file29 │ 4.1K │ 4.1K │ 4.1K │ 4.1K
├───────────────────────────────────────────────────────────────────────────────────────┤ 135.2K (12%) │ 4.1K (0%) ├────────────┼────────┴───┬────┴────────┴────────┤
│ │ ├─────────────┤ file3 │ file41 │xxxxxxxxxxxxxxxxxxxxxx│
│ │ │ file11 ├────────────┼────────────┤xxxxxxxxxxxxxxxxxxxxxx
│ │ ├─────────────┤ file30 │ file42 │xxxxxxxxxxxxxxxxxxxxxx│
│ big_file3 │ │ file12 ├────────────┼────────────┤xxxxxxxxxxxxxxxxxxxxxx
│ │ ├─────────────┤ file31 │ file43 │xxxxxxxxxxxxxxxxxxxxxx
│ │ │ file13 │ 4.1K (0%) ├────────────┤xxxxxxxxxxxxxxxxxxxxxx│
│ 135.2K (12%) │ ├─────────────┼────────────┤ file44xxxxxxxxxxxxxxxxxxxxxx
│ │ │ file14 │ file32 │ 4.1K (0%) │xxxxxxxxxxxxxxxxxxxxxx│
│ │ ├─────────────┼────────────┼────────────┤xxxxxxxxxxxxxxxxxxxxxx
│ │ │ file15 │ file33 │ file45xxxxxxxxxxxxxxxxxxxxxx
└───────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────┴─────────────┴────────────┴────────────┴──────────────────────┘
│ ├─────────────────────────────────────┬───────────┴─┬───────────┬────────────┬───────────┬───────────┤
│ │ │medium_file0 │ file16 file17 file18 file19
│ │ │ ├───────────┼────────────┼───────────┼───────────┤
├───────────────────────────────────────────────────────────────────────────────────────┤ │ 8.2K (1%) │ file2 │ file20 │ file21 file22
│ │ ├─────────────┤ 4.1K │ 4.1K (0%) │ 4.1K │ 4.1K │
│ │ │medium_file1 ├───────────┼────────────┼───────────┼───────────┤
│ │ │ │ file23 │ file24 │ file25 │ file26
│ big_file2 │ │ 8.2K (1%) ├───────────┬─────────────────────┼───────────┤
│ │ ├─────────────┤ file27 │ file34 file35 file36
│ │ │ file0 ├────────────┤ 4.1K │ 4.1K 4.1K
│ 135.2K (12%) │ ├─────────────┤ file28 ├───────────┼───────────┼───────────┤
│ │ big_file6 │ file1 │ 4.1K (0%) │ file37 file38 │ file39
│ │ ├─────────────┼────────────┼───────────┴─┬─────────┴┬──────────┤
│ │ │ file10 │ file29 │ file4 │ file45 │ file46
├───────────────────────────────────────────────────────────────────────────────────────┤ 135.2K (12%) │ 4.1K (0%) ├────────────┼─────────────┤ 4.1K │ 4.1K │
│ │ ├─────────────┤ file3 │ file40 ├──────────┼──────────┤
│ │ │ file11 ├────────────┼─────────────┤ file47 │ file48
│ │ ├─────────────┤ file30 │ file41 ├──────────┼──────────┤
│ big_file3 │ │ file12 ├────────────┤ 4.1K (0%) │ file49 │ file7
│ │ ├─────────────┤ file31 ├─────────────┤ 4.1K │ 4.1K
│ │ │ file13 │ 4.1K (0%) │ file42 ├──────────┼──────────┤
│ 135.2K (12%) │ ├─────────────┼────────────┼─────────────┤ file5 file8
│ │ │ file14 │ file32 │ file43 ├──────────┼──────────┤
│ │ ├─────────────┼────────────┼─────────────┤ file6 │ file9
│ │ │ file15 │ file33 │ file44 4.1K │ 4.1K
└───────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────┴─────────────┴────────────┴────────────┴────────────────────┘
x = Small files
<hjkl> or <arrow keys> - move around, <ENTER> - enter folder, <ESC> - parent folder, <Ctrl-D> - delete

View File

@@ -2,10 +2,10 @@
source: src/tests/cases/ui.rs
expression: "&terminal_draw_events_mirror[0]"
---
┌──────────────────────────────────────────────────────────┐┌──────────────────────┐
/tmp/bandwhich_tests/small_files_non_square (3.3M) │ /tmp/bandwhich_tests/small_files_non_square (3.3M) ││ Space freed: 0 │
└──────────────────────────────────────────────────────────┘└──────────────────────┘
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
──────────────────────────────────────────────────────────┐┌──────────────────────┐
/tmp/bandwhich_tests/small_files_non_square (10.0M) │ /tmp/bandwhich_tests/small_files_non_square (10.0M) ││ Space freed: 0 │
──────────────────────────────────────────────────────────┘└──────────────────────┘
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │ │
│ │ │
│ │ │
@@ -18,13 +18,15 @@ expression: "&terminal_draw_events_mirror[0]"
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ file1 │
│ file2 │ │
│ │ │
2.0M (62%) file1
│ │ │
│ │ │
│ │ 200.7K (6%) │
│ │ 802.8K (8%)
8.0M (80%)
│ │ │
│ │ │
│ │ │
@@ -34,22 +36,20 @@ expression: "&terminal_draw_events_mirror[0]"
│ │ │
│ │ │
│ │ │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
file3 ├────────┬─────┤
│ │xxxxx│
│ file5 xxxxx│
│ 1.0M (31%) │ 16.4K │xxxxx│
│ │xxxxx│
├────────┘xxxxx│
│xxxxxxxxxxxxxx│
│xxxxxxxxxxxxxx│
│ │xxxxxxxxxxxxxx│
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┘
│ │
├──────────┬──────┤
│ │ file5 │xxxxxx│
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┘xxxxxx│
│xxxxxxxxxxxxxxxxx│
file3 │xxxxxxxxxxxxxxxxx│
1.0M (10%) │xxxxxxxxxxxxxxxxx
│ │xxxxxxxxxxxxxxxxx│
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────┘
x = Small files
<hjkl> or <arrow keys> - move around, <ENTER> - enter folder, <ESC> - parent folder, <Ctrl-D> - delete

View File

@@ -308,11 +308,11 @@ fn small_files_non_square() {
let mut file_1_path = PathBuf::from(&temp_dir_path);
file_1_path.push("file1");
create_temp_file(file_1_path, 200000).expect("failed to create temp file");
create_temp_file(file_1_path, 800000).expect("failed to create temp file");
let mut file_2_path = PathBuf::from(&temp_dir_path);
file_2_path.push("file2");
create_temp_file(file_2_path, 2000000).expect("failed to create temp file");
create_temp_file(file_2_path, 8000000).expect("failed to create temp file");
let mut file_3_path = PathBuf::from(&temp_dir_path);
file_3_path.push("file3");
@@ -320,23 +320,67 @@ fn small_files_non_square() {
let mut file_4_path = PathBuf::from(&temp_dir_path);
file_4_path.push("file4");
create_temp_file(file_4_path, 8000).expect("failed to create temp file");
create_temp_file(file_4_path, 4000).expect("failed to create temp file");
let mut file_5_path = PathBuf::from(&temp_dir_path);
file_5_path.push("file5");
create_temp_file(file_5_path, 16000).expect("failed to create temp file");
create_temp_file(file_5_path, 29000).expect("failed to create temp file");
let mut file_6_path = PathBuf::from(&temp_dir_path);
file_6_path.push("file6");
create_temp_file(file_6_path, 8000).expect("failed to create temp file");
create_temp_file(file_6_path, 20000).expect("failed to create temp file");
let mut file_7_path = PathBuf::from(&temp_dir_path);
file_7_path.push("file7");
create_temp_file(file_7_path, 4000).expect("failed to create temp file");
create_temp_file(file_7_path, 8000).expect("failed to create temp file");
let mut file_8_path = PathBuf::from(&temp_dir_path);
file_8_path.push("file8");
create_temp_file(file_8_path, 12000).expect("failed to create temp file");
create_temp_file(file_8_path, 8000).expect("failed to create temp file");
let mut file_9_path = PathBuf::from(&temp_dir_path);
file_9_path.push("file9");
create_temp_file(file_9_path, 8000).expect("failed to create temp file");
let mut file_10_path = PathBuf::from(&temp_dir_path);
file_10_path.push("file10");
create_temp_file(file_10_path, 8000).expect("failed to create temp file");
let mut file_11_path = PathBuf::from(&temp_dir_path);
file_11_path.push("file11");
create_temp_file(file_11_path, 8000).expect("failed to create temp file");
let mut file_12_path = PathBuf::from(&temp_dir_path);
file_12_path.push("file12");
create_temp_file(file_12_path, 8000).expect("failed to create temp file");
let mut file_13_path = PathBuf::from(&temp_dir_path);
file_13_path.push("file13");
create_temp_file(file_13_path, 8000).expect("failed to create temp file");
let mut file_14_path = PathBuf::from(&temp_dir_path);
file_14_path.push("file14");
create_temp_file(file_14_path, 8000).expect("failed to create temp file");
let mut file_15_path = PathBuf::from(&temp_dir_path);
file_15_path.push("file15");
create_temp_file(file_15_path, 8000).expect("failed to create temp file");
let mut file_16_path = PathBuf::from(&temp_dir_path);
file_16_path.push("file16");
create_temp_file(file_16_path, 8000).expect("failed to create temp file");
let mut file_17_path = PathBuf::from(&temp_dir_path);
file_17_path.push("file17");
create_temp_file(file_17_path, 8000).expect("failed to create temp file");
let mut file_18_path = PathBuf::from(&temp_dir_path);
file_18_path.push("file18");
create_temp_file(file_18_path, 8000).expect("failed to create temp file");
let mut file_19_path = PathBuf::from(&temp_dir_path);
file_19_path.push("file19");
create_temp_file(file_19_path, 8000).expect("failed to create temp file");
start(backend, keyboard_events, temp_dir_path.clone());
std::fs::remove_dir_all(temp_dir_path).expect("failed to remove temporary folder");
@@ -383,27 +427,39 @@ fn cannot_move_into_small_files () {
let mut file_4_path = PathBuf::from(&temp_dir_path);
file_4_path.push("file4");
create_temp_file(file_4_path, 8000).expect("failed to create temp file");
create_temp_file(file_4_path, 4000).expect("failed to create temp file");
let mut file_5_path = PathBuf::from(&temp_dir_path);
file_5_path.push("file5");
create_temp_file(file_5_path, 8000).expect("failed to create temp file");
create_temp_file(file_5_path, 4000).expect("failed to create temp file");
let mut file_6_path = PathBuf::from(&temp_dir_path);
file_6_path.push("file6");
create_temp_file(file_6_path, 8000).expect("failed to create temp file");
create_temp_file(file_6_path, 4000).expect("failed to create temp file");
let mut file_7_path = PathBuf::from(&temp_dir_path);
file_7_path.push("file7");
create_temp_file(file_7_path, 8000).expect("failed to create temp file");
create_temp_file(file_7_path, 4000).expect("failed to create temp file");
let mut file_8_path = PathBuf::from(&temp_dir_path);
file_8_path.push("file8");
create_temp_file(file_8_path, 8000).expect("failed to create temp file");
create_temp_file(file_8_path, 4000).expect("failed to create temp file");
let mut file_9_path = PathBuf::from(&temp_dir_path);
file_9_path.push("file9");
create_temp_file(file_9_path, 8000).expect("failed to create temp file");
create_temp_file(file_9_path, 4000).expect("failed to create temp file");
let mut file_10_path = PathBuf::from(&temp_dir_path);
file_10_path.push("file10");
create_temp_file(file_10_path, 4000).expect("failed to create temp file");
let mut file_11_path = PathBuf::from(&temp_dir_path);
file_11_path.push("file11");
create_temp_file(file_11_path, 4000).expect("failed to create temp file");
let mut file_12_path = PathBuf::from(&temp_dir_path);
file_12_path.push("file12");
create_temp_file(file_12_path, 4000).expect("failed to create temp file");
start(backend, keyboard_events, temp_dir_path.clone());
std::fs::remove_dir_all(temp_dir_path).expect("failed to remove temporary folder");

View File

@@ -92,6 +92,16 @@ fn draw_rect_on_grid (buf: &mut Buffer, rect: Rect) {
}
}
fn draw_small_files_rect_on_grid(buf: &mut Buffer, rect: Rect) {
for x in rect.x..rect.width {
for y in rect.y..rect.height {
let buf = buf.get_mut(x, y);
buf.set_symbol("x");
buf.set_style(Style::default().bg(Color::White).fg(Color::Black));
}
}
}
fn draw_rect_text_on_grid(buf: &mut Buffer, rect: &Rect, file_size_rect: &FileSizeRect) { // TODO: better, combine args
let max_text_length = if rect.width > 2 { rect.width - 2 } else { 0 };
let name = &file_size_rect.file_metadata.name;
@@ -132,7 +142,7 @@ fn draw_rect_text_on_grid(buf: &mut Buffer, rect: &Rect, file_size_rect: &FileSi
let second_line = truncate_size_line(&file_size_rect.file_metadata.size, &percentage, &max_text_length);
let second_line_length = second_line.len(); // TODO: better
let second_line_start_position = ((rect.width - second_line_length as u16) as f64 / 2.0).ceil() as u16 + rect.x;
let second_line_start_position = ((rect.width - second_line_length as u16) as f64 / 2.0).ceil() as u16 + rect.x; // TODO: we get "subtract with overflow" errors here, fix this
let first_line_style = if file_size_rect.selected {
@@ -182,11 +192,79 @@ fn draw_rect_text_on_grid(buf: &mut Buffer, rect: &Rect, file_size_rect: &FileSi
}
}
struct SmallFilesArea {
leftmost_top_left_coordinates: Option<(u16, u16)>,
highest_top_left_coordinates: Option<(u16, u16)>,
}
impl SmallFilesArea {
pub fn new () -> Self {
Self {
leftmost_top_left_coordinates: None,
highest_top_left_coordinates: None,
}
}
pub fn add_rect(&mut self, rect: &Rect) {
match self.leftmost_top_left_coordinates {
Some((x, y)) => {
if rect.x < x {
self.leftmost_top_left_coordinates = Some((rect.x, rect.y));
} else if rect.x == x && rect.y < y {
self.leftmost_top_left_coordinates = Some((rect.x, rect.y));
}
},
None => {
self.leftmost_top_left_coordinates = Some((rect.x, rect.y));
}
}
match self.highest_top_left_coordinates {
Some((x, y)) => {
if rect.y < y {
self.highest_top_left_coordinates = Some((rect.x, rect.y));
} else if rect.y == y && rect.x < x {
self.highest_top_left_coordinates = Some((rect.x, rect.y));
}
},
None => {
self.highest_top_left_coordinates = Some((rect.x, rect.y));
}
}
}
pub fn draw(&self, area: &Rect, buf: &mut Buffer) {
if let Some((small_files_start_x, small_files_start_y)) = self.highest_top_left_coordinates {
if small_files_start_x > 0 && small_files_start_y > 0 {
draw_small_files_rect_on_grid(buf, Rect {
x: small_files_start_x + 1,
y: small_files_start_y + 1,
width: area.x + area.width,
height: area.y + area.height,
});
} else {
// TODO: ui indication that we have X small unrenderable files
}
}
if let Some((small_files_start_x, small_files_start_y)) = self.leftmost_top_left_coordinates {
if small_files_start_x > 0 && small_files_start_y > 0 {
draw_small_files_rect_on_grid(buf, Rect {
x: small_files_start_x + 1,
y: small_files_start_y + 1,
width: area.x + area.width,
height: area.y + area.height,
});
} else {
// TODO: ui indication that we have X small unrenderable files
}
}
}
}
impl<'a> Widget for RectangleGrid {
fn draw(&mut self, area: Rect, buf: &mut Buffer) {
if area.width < 2 || area.height < 2 {
return;
}
let mut small_files = SmallFilesArea::new();
for file_size_rect in &self.rectangles {
let rounded_x = file_size_rect.rect.x.round();
let rounded_y = file_size_rect.rect.y.round();
@@ -205,24 +283,14 @@ impl<'a> Widget for RectangleGrid {
rect.height += 1;
}
if rect.height < MINIMUM_HEIGHT || rect.width < MINIMUM_WIDTH {
for x in rect.x..(rect.x + rect.width + 1) { // +1 because the width might be 0
if x > rect.x && x < area.x + area.width {
for y in rect.y..(rect.y + rect.height + 1) { // +1 because the height might be 0
if y > rect.y && y < area.y + area.height {
let buf = buf.get_mut(x, y);
buf.set_symbol("x");
buf.set_style(Style::default().bg(Color::White).fg(Color::Black));
}
}
}
}
if file_size_rect.rect.height < MINIMUM_HEIGHT as f64 || file_size_rect.rect.width < MINIMUM_WIDTH as f64 {
small_files.add_rect(&rect);
} else {
draw_rect_text_on_grid(buf, &rect, &file_size_rect);
draw_rect_on_grid(buf, rect);
}
}
small_files.draw(&area, buf);
draw_rect_on_grid(buf, area); // we draw a frame around the whole area to make up for the "small files" block not having a frame of its own
}
}

View File

@@ -103,7 +103,6 @@ impl Tiles {
}
pub fn change_files(&mut self, file_list: Vec<FileMetadata>) {
self.files = file_list;
// self.selected_index = None;
self.fill();
}
pub fn change_area(&mut self, area: &Rect) {

View File

@@ -1,5 +1,5 @@
use crate::ui::FileMetadata;
use crate::ui::rectangle_grid::{FileSizeRect, RectFloat} ;
use crate::ui::rectangle_grid::{FileSizeRect, RectFloat, MINIMUM_HEIGHT, MINIMUM_WIDTH} ;
const HEIGHT_WIDTH_RATIO: f64 = 2.5;
@@ -69,7 +69,7 @@ impl TreeMap {
}
}
fn worst (&self, row: &Vec<&FileMetadata>, length_of_row: f64) -> f64 {
fn worst (&self, row: &Vec<&FileMetadata>, length_of_row: f64, min_first_side: f64, min_second_side: f64) -> f64 {
let sum = row.iter().fold(0.0, |accum, file_metadata| {
let size = file_metadata.percentage * self.total_size;
accum + size
@@ -79,7 +79,7 @@ impl TreeMap {
let size = val.percentage * self.total_size;
let first_side = (size / sum) * length_of_row;
let second_side = size / first_side;
if first_side >= 5.0 && second_side >= 5.0 {
if first_side >= min_first_side && second_side >= min_second_side {
let val_aspect_ratio = if first_side < second_side {
first_side / second_side
} else {
@@ -97,11 +97,21 @@ impl TreeMap {
worst_aspect_ratio
}
fn has_renderable_items (&self, row: &Vec<&FileMetadata>, min_first_side: f64, min_second_side: f64) -> bool {
for val in row.iter() {
let size = val.percentage * self.total_size;
if min_first_side * min_second_side <= size {
return true
}
}
return false;
}
pub fn squarify (&mut self, mut children: Vec<FileMetadata>, mut row: Vec<FileMetadata>) {
let length_of_row = if self.empty_space.height * HEIGHT_WIDTH_RATIO < self.empty_space.width {
self.empty_space.height * 2.5
let (length_of_row, min_first_side, min_second_side) = if self.empty_space.height * HEIGHT_WIDTH_RATIO < self.empty_space.width {
(self.empty_space.height * HEIGHT_WIDTH_RATIO, MINIMUM_HEIGHT as f64 * HEIGHT_WIDTH_RATIO, MINIMUM_WIDTH as f64 / HEIGHT_WIDTH_RATIO)
} else {
self.empty_space.width * 0.6
(self.empty_space.width / HEIGHT_WIDTH_RATIO, MINIMUM_WIDTH as f64 / HEIGHT_WIDTH_RATIO, MINIMUM_HEIGHT as f64 * HEIGHT_WIDTH_RATIO)
};
if children.len() == 0 && !row.is_empty() { // TODO: better
@@ -112,9 +122,26 @@ impl TreeMap {
let mut row_refs: Vec<&FileMetadata> = row.iter().collect();
let current_row_worst_ratio = self.worst(&row_refs, length_of_row);
let current_row_worst_ratio = self.worst(&row_refs, length_of_row, min_first_side, min_second_side);
let children_refs: Vec<&FileMetadata> = children.iter().collect();
if !self.has_renderable_items(&children_refs, min_first_side, min_second_side) {
if row.len() > 0 {
self.layoutrow(row);
self.squarify(children, vec![]);
} else {
for child in children.drain(..) {
row.push(child);
}
self.layoutrow(row);
self.squarify(children, vec![]);
}
return;
}
row_refs.push(&children[0]);
let row_with_child_worst_ratio = self.worst(&row_refs, length_of_row);
let row_with_child_worst_ratio = self.worst(&row_refs, length_of_row, min_first_side, min_second_side);
if current_row_worst_ratio != 0.0 && row_with_child_worst_ratio == 0.0 {
self.layoutrow(row);