aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-01-05 04:54:14 +0300
committerChristian Duerr <contact@christianduerr.com>2020-01-05 01:54:14 +0000
commit0cc68da04f109f66159aadc2404e232ab96bb97e (patch)
tree9d54e8accf059ce70039b29cfd7ac54836d9ce0e /alacritty/src
parent1cfb0740bc530da3162292bbf682a234240f26a3 (diff)
downloadr-alacritty-0cc68da04f109f66159aadc2404e232ab96bb97e.tar.gz
r-alacritty-0cc68da04f109f66159aadc2404e232ab96bb97e.tar.bz2
r-alacritty-0cc68da04f109f66159aadc2404e232ab96bb97e.zip
Add `Minimize` binding action
Fixes #2534.
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/config/bindings.rs4
-rw-r--r--alacritty/src/input.rs1
-rw-r--r--alacritty/src/window.rs4
3 files changed, 9 insertions, 0 deletions
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs
index dbe5d42e..d12c5708 100644
--- a/alacritty/src/config/bindings.rs
+++ b/alacritty/src/config/bindings.rs
@@ -167,6 +167,9 @@ pub enum Action {
/// Hide the Alacritty window.
Hide,
+ /// Minimize the Alacritty window.
+ Minimize,
+
/// Quit Alacritty.
Quit,
@@ -430,6 +433,7 @@ pub fn platform_key_bindings() -> Vec<KeyBinding> {
Key::V, ModifiersState::LOGO; Action::Paste;
Key::C, ModifiersState::LOGO; Action::Copy;
Key::H, ModifiersState::LOGO; Action::Hide;
+ Key::M, ModifiersState::LOGO; Action::Minimize;
Key::Q, ModifiersState::LOGO; Action::Quit;
Key::W, ModifiersState::LOGO; Action::Quit;
)
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index dff46515..08383eab 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -137,6 +137,7 @@ impl<T: EventListener> Execute<T> for Action {
#[cfg(target_os = "macos")]
Action::ToggleSimpleFullscreen => ctx.window_mut().toggle_simple_fullscreen(),
Action::Hide => ctx.window().set_visible(false),
+ Action::Minimize => ctx.window().set_minimized(true),
Action::Quit => ctx.terminal_mut().exit(),
Action::IncreaseFontSize => ctx.change_font_size(FONT_SIZE_STEP),
Action::DecreaseFontSize => ctx.change_font_size(FONT_SIZE_STEP * -1.),
diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs
index 159e746e..33594741 100644
--- a/alacritty/src/window.rs
+++ b/alacritty/src/window.rs
@@ -319,6 +319,10 @@ impl Window {
self.window().set_maximized(maximized);
}
+ pub fn set_minimized(&self, minimized: bool) {
+ self.window().set_minimized(minimized);
+ }
+
/// Toggle the window's fullscreen state
pub fn toggle_fullscreen(&mut self) {
self.set_fullscreen(self.window().fullscreen().is_none());