diff options
| author | Roee Shapira <35409124+5c077m4n@users.noreply.github.com> | 2020-11-19 12:15:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-19 11:15:59 +0100 |
| commit | 5ddf95a16c8d1c9632ba6cef56f55fcf8bf9e4ea (patch) | |
| tree | 94a00125fb99f7cf0953e20052eb000647c9f212 /src/screen.rs | |
| parent | fix(ux): disable move focus when in full screen (#49) (diff) | |
| download | sl0ppij-5ddf95a16c8d1c9632ba6cef56f55fcf8bf9e4ea.tar.gz sl0ppij-5ddf95a16c8d1c9632ba6cef56f55fcf8bf9e4ea.tar.xz sl0ppij-5ddf95a16c8d1c9632ba6cef56f55fcf8bf9e4ea.zip | |
fix(compatibility): some fixes for htop (#53)
* Moved all log to file functions to one module.
* Moved logging to file function to utils module.
* Housekeeping.
* Housekeeping.
* Started investigation into htop CSIs.
* Used better function for scrolling.
* Minor cleanup.
* Cleanup and start of scroll region rotation.
* Implemented scroll region rotation.
* Improved performace.
* New SCI found.
* Typo.
* Typo.
* Removed logging function.
* Added scroll rotation functions.
* Typo.
* Moved all logging function to one module.
* Attempt at making htop work.
* Reverted unneeded changes.
* Improved log file name creation.
* Ran rust fmt.
* PR review edits.
* PR review edits.
* Used mark_for_rerender function.
* Removed _ prefix from logging functions.
Diffstat (limited to 'src/screen.rs')
| -rw-r--r-- | src/screen.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/screen.rs b/src/screen.rs index cf67909c..76c7b182 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -19,19 +19,7 @@ use crate::AppInstruction; * */ -fn _debug_log_to_file(message: String) { - use std::fs::OpenOptions; - use std::io::prelude::*; - let mut file = OpenOptions::new() - .append(true) - .create(true) - .open("/tmp/mosaic-log.txt") - .unwrap(); - file.write_all(message.as_bytes()).unwrap(); - file.write_all("\n".as_bytes()).unwrap(); -} - -const CURSOR_HEIGHT_WIDGH_RATIO: usize = 4; // this is not accurate and kind of a magic number, TODO: look into this +const CURSOR_HEIGHT_WIDTH_RATIO: usize = 4; // this is not accurate and kind of a magic number, TODO: look into this type BorderAndPaneIds = (usize, Vec<RawFd>); @@ -206,7 +194,7 @@ impl Screen { (0, 0), |(current_longest_edge, current_terminal_id_to_split), id_and_terminal_to_check| { let (id_of_terminal_to_check, terminal_to_check) = id_and_terminal_to_check; - let terminal_size = (terminal_to_check.get_rows() * CURSOR_HEIGHT_WIDGH_RATIO) + let terminal_size = (terminal_to_check.get_rows() * CURSOR_HEIGHT_WIDTH_RATIO) * terminal_to_check.get_columns(); if terminal_size > current_longest_edge { (terminal_size, *id_of_terminal_to_check) @@ -222,7 +210,7 @@ impl Screen { ws_xpixel: terminal_to_split.get_x() as u16, ws_ypixel: terminal_to_split.get_y() as u16, }; - if terminal_to_split.get_rows() * CURSOR_HEIGHT_WIDGH_RATIO + if terminal_to_split.get_rows() * CURSOR_HEIGHT_WIDTH_RATIO > terminal_to_split.get_columns() { let (top_winsize, bottom_winsize) = split_horizontally_with_gap(&terminal_ws); |
