diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-11 07:33:35 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-11 07:33:35 +0000 |
| commit | efcd36a52c203b082e931ae06cecfb475e61547f (patch) | |
| tree | b0062a93edb85cb15346c126509693d9c104bdf9 /src/panes | |
| parent | Add a plugin callback for global keypresses (diff) | |
| download | sl0ppij-efcd36a52c203b082e931ae06cecfb475e61547f.tar.gz sl0ppij-efcd36a52c203b082e931ae06cecfb475e61547f.tar.xz sl0ppij-efcd36a52c203b082e931ae06cecfb475e61547f.zip | |
Added the set_selectable plugin API function
Diffstat (limited to 'src/panes')
| -rw-r--r-- | src/panes/plugin_pane.rs | 8 | ||||
| -rw-r--r-- | src/panes/terminal_pane.rs | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/panes/plugin_pane.rs b/src/panes/plugin_pane.rs index 1573d577..a93ff8c0 100644 --- a/src/panes/plugin_pane.rs +++ b/src/panes/plugin_pane.rs @@ -9,6 +9,7 @@ use crate::panes::{PaneId, PositionAndSize}; pub struct PluginPane { pub pid: u32, pub should_render: bool, + pub selectable: bool, pub position_and_size: PositionAndSize, pub position_and_size_override: Option<PositionAndSize>, pub send_plugin_instructions: SenderWithContext<PluginInstruction>, @@ -23,6 +24,7 @@ impl PluginPane { Self { pid, should_render: true, + selectable: true, position_and_size, position_and_size_override: None, send_plugin_instructions, @@ -92,6 +94,12 @@ impl Pane for PluginPane { fn set_should_render(&mut self, should_render: bool) { self.should_render = should_render; } + fn selectable(&self) -> bool { + self.selectable + } + fn set_selectable(&mut self, selectable: bool) { + self.selectable = selectable; + } fn render(&mut self) -> Option<String> { // if self.should_render { if true { diff --git a/src/panes/terminal_pane.rs b/src/panes/terminal_pane.rs index 0d04c681..d15c7649 100644 --- a/src/panes/terminal_pane.rs +++ b/src/panes/terminal_pane.rs @@ -38,6 +38,7 @@ pub struct TerminalPane { pub pid: RawFd, pub scroll: Scroll, pub should_render: bool, + pub selectable: bool, 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") @@ -165,6 +166,12 @@ impl Pane for TerminalPane { fn set_should_render(&mut self, should_render: bool) { self.should_render = should_render; } + fn selectable(&self) -> bool { + self.selectable + } + fn set_selectable(&mut self, selectable: bool) { + self.selectable = selectable; + } fn render(&mut self) -> Option<String> { // if self.should_render { if true { @@ -274,6 +281,7 @@ impl TerminalPane { pid, scroll, should_render: true, + selectable: true, pending_styles, position_and_size, position_and_size_override: None, |
