1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Add option for launching Alacritty maximized

This commit is contained in:
Jonathan Dahan 2018-11-19 16:23:47 -05:00 committed by Christian Duerr
parent fc04bc1e6d
commit 2ede659134
6 changed files with 23 additions and 1 deletions

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Option for evenly spreading extra padding around the terminal (`window.dynamic_padding`) - 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 - Display notice about errors and warnings inside Alacritty
- Log all messages to both stderr and a log file in the system's temporary directory - 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`, - New configuration option `persistent_logging` and CLI flag `--persistent-logging`,

View file

@ -39,6 +39,9 @@ window:
# - none: Neither borders nor title bar # - none: Neither borders nor title bar
decorations: full decorations: full
# When true, alacritty starts maximized.
start_maximized: false
scrolling: scrolling:
# Maximum number of lines in the scrollback buffer. # Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling. # Specifying '0' will disable scrolling.

View file

@ -50,6 +50,9 @@ window:
# - transparent: Title bar, transparent background, but no title bar buttons # - transparent: Title bar, transparent background, but no title bar buttons
decorations: full decorations: full
# When true, alacritty starts maximized.
start_maximized: false
scrolling: scrolling:
# Maximum number of lines in the scrollback buffer. # Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling. # Specifying '0' will disable scrolling.

View file

@ -39,6 +39,9 @@ window:
# - none: Neither borders nor title bar # - none: Neither borders nor title bar
decorations: full decorations: full
# When true, alacritty starts maximized.
start_maximized: false
scrolling: scrolling:
# Maximum number of lines in the scrollback buffer. # Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling. # Specifying '0' will disable scrolling.

View file

@ -380,6 +380,10 @@ pub struct WindowConfig {
/// Spread out additional padding evenly /// Spread out additional padding evenly
#[serde(default, deserialize_with = "failure_default")] #[serde(default, deserialize_with = "failure_default")]
dynamic_padding: bool, dynamic_padding: bool,
/// Start maximized
#[serde(default, deserialize_with = "failure_default")]
start_maximized: bool,
} }
fn default_padding() -> Delta<u8> { fn default_padding() -> Delta<u8> {
@ -406,6 +410,10 @@ impl WindowConfig {
pub fn dynamic_padding(&self) -> bool { pub fn dynamic_padding(&self) -> bool {
self.dynamic_padding self.dynamic_padding
} }
pub fn start_maximized(&self) -> bool {
self.start_maximized
}
} }
impl Default for WindowConfig { impl Default for WindowConfig {
@ -415,6 +423,7 @@ impl Default for WindowConfig {
padding: default_padding(), padding: default_padding(),
decorations: Default::default(), decorations: Default::default(),
dynamic_padding: false, dynamic_padding: false,
start_maximized: false,
} }
} }
} }

View file

@ -300,6 +300,7 @@ impl Window {
.with_title(title) .with_title(title)
.with_visibility(false) .with_visibility(false)
.with_transparency(true) .with_transparency(true)
.with_maximized(window_config.start_maximized())
.with_decorations(decorations) .with_decorations(decorations)
} }
@ -317,6 +318,7 @@ impl Window {
.with_visibility(cfg!(windows)) .with_visibility(cfg!(windows))
.with_decorations(decorations) .with_decorations(decorations)
.with_transparency(true) .with_transparency(true)
.with_maximized(window_config.start_maximized())
.with_window_icon(Some(icon)) .with_window_icon(Some(icon))
} }
@ -327,7 +329,8 @@ impl Window {
let window = WindowBuilder::new() let window = WindowBuilder::new()
.with_title(title) .with_title(title)
.with_visibility(false) .with_visibility(false)
.with_transparency(true); .with_transparency(true)
.with_maximized(window_config.start_maximized());
match window_config.decorations() { match window_config.decorations() {
Decorations::Full => window, Decorations::Full => window,