From e9813031f6e308984cb5547aa1049839cb75745f Mon Sep 17 00:00:00 2001 From: acheronfail Date: Wed, 24 Apr 2019 05:05:47 +1000 Subject: Add fullscreen support Fixes #34. Fixes #2012. --- src/input.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/input.rs') 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 } -- cgit