diff options
author | Jonathan Dahan <hi@jonathan.is> | 2018-11-19 16:23:47 -0500 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-11-19 21:23:47 +0000 |
commit | 2ede659134936fe294f454a6b2247e1918af6f51 (patch) | |
tree | 13f97679a4fd29f267a84338206e5e6f8427bc17 | |
parent | fc04bc1e6dfc6f1bd3f0a70b1d6d2b6cbc551d40 (diff) | |
download | alacritty-2ede659134936fe294f454a6b2247e1918af6f51.tar.gz alacritty-2ede659134936fe294f454a6b2247e1918af6f51.zip |
Add option for launching Alacritty maximized
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty.yml | 3 | ||||
-rw-r--r-- | alacritty_macos.yml | 3 | ||||
-rw-r--r-- | alacritty_windows.yml | 3 | ||||
-rw-r--r-- | src/config.rs | 9 | ||||
-rw-r--r-- | src/window.rs | 5 |
6 files changed, 23 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2facda65..a9fbbfaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Option for evenly spreading extra padding around the terminal (`window.dynamic_padding`) +- Option for maximizing alacritty on start (`window.start_maximized`) - Display notice about errors and warnings inside Alacritty - Log all messages to both stderr and a log file in the system's temporary directory - New configuration option `persistent_logging` and CLI flag `--persistent-logging`, diff --git a/alacritty.yml b/alacritty.yml index ebba9920..fdd7f4f3 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -39,6 +39,9 @@ window: # - none: Neither borders nor title bar decorations: full + # When true, alacritty starts maximized. + start_maximized: false + scrolling: # Maximum number of lines in the scrollback buffer. # Specifying '0' will disable scrolling. diff --git a/alacritty_macos.yml b/alacritty_macos.yml index db6fa8ca..9aa08f44 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -50,6 +50,9 @@ window: # - transparent: Title bar, transparent background, but no title bar buttons decorations: full + # When true, alacritty starts maximized. + start_maximized: false + scrolling: # Maximum number of lines in the scrollback buffer. # Specifying '0' will disable scrolling. diff --git a/alacritty_windows.yml b/alacritty_windows.yml index b37a4532..b7ca1259 100644 --- a/alacritty_windows.yml +++ b/alacritty_windows.yml @@ -39,6 +39,9 @@ window: # - none: Neither borders nor title bar decorations: full + # When true, alacritty starts maximized. + start_maximized: false + scrolling: # Maximum number of lines in the scrollback buffer. # Specifying '0' will disable scrolling. diff --git a/src/config.rs b/src/config.rs index d56e8578..4f62440a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -380,6 +380,10 @@ pub struct WindowConfig { /// Spread out additional padding evenly #[serde(default, deserialize_with = "failure_default")] dynamic_padding: bool, + + /// Start maximized + #[serde(default, deserialize_with = "failure_default")] + start_maximized: bool, } fn default_padding() -> Delta<u8> { @@ -406,6 +410,10 @@ impl WindowConfig { pub fn dynamic_padding(&self) -> bool { self.dynamic_padding } + + pub fn start_maximized(&self) -> bool { + self.start_maximized + } } impl Default for WindowConfig { @@ -415,6 +423,7 @@ impl Default for WindowConfig { padding: default_padding(), decorations: Default::default(), dynamic_padding: false, + start_maximized: false, } } } diff --git a/src/window.rs b/src/window.rs index 31b7c766..de3eb9a6 100644 --- a/src/window.rs +++ b/src/window.rs @@ -300,6 +300,7 @@ impl Window { .with_title(title) .with_visibility(false) .with_transparency(true) + .with_maximized(window_config.start_maximized()) .with_decorations(decorations) } @@ -317,6 +318,7 @@ impl Window { .with_visibility(cfg!(windows)) .with_decorations(decorations) .with_transparency(true) + .with_maximized(window_config.start_maximized()) .with_window_icon(Some(icon)) } @@ -327,7 +329,8 @@ impl Window { let window = WindowBuilder::new() .with_title(title) .with_visibility(false) - .with_transparency(true); + .with_transparency(true) + .with_maximized(window_config.start_maximized()); match window_config.decorations() { Decorations::Full => window, |