feat: horizontally scroll across log
By default, use left and right arrow keys to horizontally scroll over the lines of logs, also has various refactors to reduced to size of the vec of logs sent to the ui renderer
This commit is contained in:
@@ -187,6 +187,7 @@ pub struct GuiState {
|
||||
log_height: u16,
|
||||
rerender: Arc<Rerender>,
|
||||
selected_panel: SelectablePanel,
|
||||
screen_width: u16,
|
||||
show_logs: bool,
|
||||
status: HashSet<Status>,
|
||||
pub info_box_text: Option<(String, Instant)>,
|
||||
@@ -205,6 +206,7 @@ impl GuiState {
|
||||
loading_index: 0,
|
||||
loading_set: HashSet::new(),
|
||||
log_height: 75,
|
||||
screen_width: 0,
|
||||
rerender: Arc::clone(redraw),
|
||||
selected_panel: SelectablePanel::default(),
|
||||
show_logs,
|
||||
@@ -232,6 +234,16 @@ impl GuiState {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the screen width, used for offset char calculations
|
||||
pub const fn set_screen_width(&mut self, width: u16) {
|
||||
self.screen_width = width;
|
||||
}
|
||||
|
||||
/// Get the screen width, used for offset char calculations
|
||||
pub const fn get_screen_width(&self) -> u16 {
|
||||
self.screen_width
|
||||
}
|
||||
|
||||
pub const fn get_show_logs(&self) -> bool {
|
||||
self.show_logs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user