summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2024-10-28 21:45:28 +0100
committerqkzk <qu3nt1n@gmail.com>2024-10-28 21:45:28 +0100
commit86e5f38b7f5228d9aae4e383db4536ef6fca5f1c (patch)
tree0afa3a8ed751228c2c0d5bee08d3c97c0534983a
parent6d708478dd6e6c1dd780d3ee67d397bfe6b3c7cd (diff)
FIX: input_simple: when height is low, static elements are out of the window
-rw-r--r--development.md13
-rw-r--r--src/io/display.rs11
2 files changed, 17 insertions, 7 deletions
diff --git a/development.md b/development.md
index 9eedcf0f..be90b600 100644
--- a/development.md
+++ b/development.md
@@ -1371,7 +1371,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [ ] prepare for new version
- [ ] test every mode
- [ ] trash: bottom line is wrong "Enter" doesn't select but restore - refresh & reselect
- - [ ] sort: when height is low, elements are out of the window
+ - [x] FIX: input_simple: when height is low, static elements are out of the window
- [x] FIX: crash when deleting a file in tree mode
- [x] doc
- [ ] ???
@@ -1380,10 +1380,13 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
### Next version
-- [ ] "+" should enter chmod
-- [ ] chmod should detect text input and react to it.
- typing rwxrwxrwx should be accepted
- typing 777 also
+- [ ] static lines (from display, menu, content per mode) can be cut out of the window. Should use the space on the right
+- [ ] chmod is crap
+ - [ ] "+" should enter chmod
+ - [ ] chmod should detect text input and react to it.
+ - [x] 777 is accepted
+ - [ ] rwxrwxrwx should be accepted
+ - [ ] +x & all chmod syntax should be accepted too
- [ ] display preview of flagged files in menu flagged.
- [ ] why have a bottom line in menu if the binds are always explained ?
- [ ] preview should display how the file is previewed even if it's obvious "Previewed as binary file"
diff --git a/src/io/display.rs b/src/io/display.rs
index a01fb03a..8ed1382b 100644
--- a/src/io/display.rs
+++ b/src/io/display.rs
@@ -1148,7 +1148,15 @@ impl<'a> Menu<'a> {
}
fn static_lines(lines: &[&str], f: &mut Frame, rect: &Rect) {
+ log_info!(
+ "len: {len}, height: {height} - rect {rect}",
+ len = lines.len(),
+ height = rect.height
+ );
for (row, line, style) in enumerated_colored_iter!(lines) {
+ if row + 2 >= rect.height as usize {
+ break;
+ }
Self::content_line(f, rect, row as u16, line, style);
}
}
@@ -1395,7 +1403,7 @@ impl<'a> Menu<'a> {
}
}
- fn content_line(f: &mut Frame, rect: &Rect, row: u16, text: &str, style: Style) -> usize {
+ fn content_line(f: &mut Frame, rect: &Rect, row: u16, text: &str, style: Style) {
rect.print_with_style(
f,
row + ContentWindow::WINDOW_MARGIN_TOP_U16,
@@ -1403,7 +1411,6 @@ impl<'a> Menu<'a> {
text,
style,
);
- text.len()
}
}