diff options
author | Anders Rasmussen <divinegod@gmail.com> | 2017-02-05 21:01:26 +1100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-02-06 20:45:17 -0800 |
commit | edc2c7f5b9784310f150724a786ae3bc3be74490 (patch) | |
tree | 42b6c6dfdf5f4d202f8ec02b309637586ab9e2a8 /src/display.rs | |
parent | 9d44526bf9ac8f20b090cc8a9279e527ec07d189 (diff) | |
download | alacritty-edc2c7f5b9784310f150724a786ae3bc3be74490.tar.gz alacritty-edc2c7f5b9784310f150724a786ae3bc3be74490.zip |
Configurable window dimensions
Adds a configuration option `dimensions` which will set initial
window size by columns and lines. Changes to the config file will
require restart.
resolves #370
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/display.rs b/src/display.rs index b1ab3ed9..0b242b33 100644 --- a/src/display.rs +++ b/src/display.rs @@ -177,8 +177,10 @@ impl Display { let cell_height = (metrics.line_height + font.offset().y() as f64) as u32; // Resize window to specified dimensions - let width = cell_width * options.columns_u32() + 4; - let height = cell_height * options.lines_u32() + 4; + let dimensions = options.dimensions() + .unwrap_or_else(|| config.dimensions()); + let width = cell_width * dimensions.columns_u32() + 4; + let height = cell_height * dimensions.lines_u32() + 4; let size = Size { width: Pixels(width), height: Pixels(height) }; info!("set_inner_size: {}", size); |