diff options
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs index 9619ffa7..fc79b398 100644 --- a/src/input.rs +++ b/src/input.rs @@ -81,6 +81,9 @@ pub trait ActionContext { fn terminal(&self) -> &Term; fn terminal_mut(&mut self) -> &mut Term; fn spawn_new_instance(&mut self); + fn toggle_fullscreen(&mut self); + #[cfg(target_os = "macos")] + fn toggle_simple_fullscreen(&mut self); } /// Describes a state and action to take in that state @@ -250,6 +253,13 @@ pub enum Action { /// Spawn a new instance of Alacritty. SpawnNewInstance, + /// Toggle fullscreen. + ToggleFullscreen, + + /// Toggle simple fullscreen on macos. + #[cfg(target_os = "macos")] + ToggleSimpleFullscreen, + /// No action. None, } @@ -302,6 +312,13 @@ impl Action { }, } }, + Action::ToggleFullscreen => { + ctx.toggle_fullscreen(); + }, + #[cfg(target_os = "macos")] + Action::ToggleSimpleFullscreen => { + ctx.toggle_simple_fullscreen(); + }, Action::Hide => { ctx.hide_window(); }, @@ -995,6 +1012,11 @@ mod tests { fn spawn_new_instance(&mut self) {} + fn toggle_fullscreen(&mut self) {} + + #[cfg(target_os = "macos")] + fn toggle_simple_fullscreen(&mut self) {} + fn terminal(&self) -> &Term { &self.terminal } |