diff options
author | acheronfail <acheronfail@gmail.com> | 2019-04-24 05:05:47 +1000 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-04-23 19:05:47 +0000 |
commit | e9813031f6e308984cb5547aa1049839cb75745f (patch) | |
tree | c8e6286c98f4f42b6e170e477baa6b1f949b83ef /src/input.rs | |
parent | b0efa9d105b53211d8df094238c7eb8324e93566 (diff) | |
download | alacritty-e9813031f6e308984cb5547aa1049839cb75745f.tar.gz alacritty-e9813031f6e308984cb5547aa1049839cb75745f.zip |
Add fullscreen support
Fixes #34.
Fixes #2012.
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 } |