From edc2c7f5b9784310f150724a786ae3bc3be74490 Mon Sep 17 00:00:00 2001 From: Anders Rasmussen Date: Sun, 5 Feb 2017 21:01:26 +1100 Subject: 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 --- src/display.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/display.rs') 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); -- cgit v1.2.3-54-g00ecf