diff options
| author | denis <denismaximov98@gmail.com> | 2021-01-29 06:24:59 +0200 |
|---|---|---|
| committer | denis <denismaximov98@gmail.com> | 2021-01-29 06:24:59 +0200 |
| commit | 6a3481f54f0ee789ceeb994d8f302e3ce119c031 (patch) | |
| tree | 60d4ad8d08c2349571d29d68c357ac07c6acce63 /src/client/panes | |
| parent | wip: oops shouldn't forget that (diff) | |
| parent | feat(statusbar): max status bar height (#156) (diff) | |
| download | sl0ppij-6a3481f54f0ee789ceeb994d8f302e3ce119c031.tar.gz sl0ppij-6a3481f54f0ee789ceeb994d8f302e3ce119c031.tar.xz sl0ppij-6a3481f54f0ee789ceeb994d8f302e3ce119c031.zip | |
Merge branch 'main' into restructure
Diffstat (limited to 'src/client/panes')
| -rw-r--r-- | src/client/panes/plugin_pane.rs | 8 | ||||
| -rw-r--r-- | src/client/panes/terminal_pane.rs | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/client/panes/plugin_pane.rs b/src/client/panes/plugin_pane.rs index a93ff8c0..aeda170a 100644 --- a/src/client/panes/plugin_pane.rs +++ b/src/client/panes/plugin_pane.rs @@ -13,6 +13,7 @@ pub struct PluginPane { pub position_and_size: PositionAndSize, pub position_and_size_override: Option<PositionAndSize>, pub send_plugin_instructions: SenderWithContext<PluginInstruction>, + pub max_height: Option<usize>, } impl PluginPane { @@ -28,6 +29,7 @@ impl PluginPane { position_and_size, position_and_size_override: None, send_plugin_instructions, + max_height: None, } } } @@ -100,6 +102,9 @@ impl Pane for PluginPane { fn set_selectable(&mut self, selectable: bool) { self.selectable = selectable; } + fn set_max_height(&mut self, max_height: usize) { + self.max_height = Some(max_height); + } fn render(&mut self) -> Option<String> { // if self.should_render { if true { @@ -172,4 +177,7 @@ impl Pane for PluginPane { fn clear_scroll(&mut self) { unimplemented!() } + fn max_height(&self) -> Option<usize> { + self.max_height + } } diff --git a/src/client/panes/terminal_pane.rs b/src/client/panes/terminal_pane.rs index 853ae064..fe7fb585 100644 --- a/src/client/panes/terminal_pane.rs +++ b/src/client/panes/terminal_pane.rs @@ -46,6 +46,7 @@ pub struct TerminalPane { pub position_and_size: PositionAndSize, pub position_and_size_override: Option<PositionAndSize>, pub cursor_key_mode: bool, // DECCKM - when set, cursor keys should send ANSI direction codes (eg. "OD") instead of the arrow keys (eg. "[D") + pub max_height: Option<usize>, pending_styles: CharacterStyles, clear_viewport_before_rendering: bool, } @@ -177,6 +178,12 @@ impl Pane for TerminalPane { fn set_selectable(&mut self, selectable: bool) { self.selectable = selectable; } + fn set_max_height(&mut self, max_height: usize) { + self.max_height = Some(max_height); + } + fn max_height(&self) -> Option<usize> { + self.max_height + } fn render(&mut self) -> Option<String> { // if self.should_render { if true { @@ -309,6 +316,7 @@ impl TerminalPane { position_and_size_override: None, cursor_key_mode: false, clear_viewport_before_rendering: false, + max_height: None, } } pub fn mark_for_rerender(&mut self) { |
