From d68ecb0deff8b966a0c7d09203d14bfdf5ccd8ad Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 15 Nov 2018 19:57:15 +0000 Subject: Add option for dynamic padding (#1780) This adds the `window.dynamic_padding` option which allows disabling the dynamic spread of additional padding around the grid's content. Based on the feedback I've gotten so far and the fact that most other terminal emulators do not seem to center the content inside themselves, I've changed the default configuration option to disable centering of the grid. This fixes #1778. --- src/config.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index b638ea43..ee30c085 100644 --- a/src/config.rs +++ b/src/config.rs @@ -376,6 +376,10 @@ pub struct WindowConfig { /// Draw the window with title bar / borders #[serde(default)] decorations: Decorations, + + /// Spread out additional padding evenly + #[serde(default, deserialize_with = "failure_default")] + dynamic_padding: bool, } fn default_padding() -> Delta { @@ -398,6 +402,10 @@ impl WindowConfig { pub fn decorations(&self) -> Decorations { self.decorations } + + pub fn dynamic_padding(&self) -> bool { + self.dynamic_padding + } } impl Default for WindowConfig { @@ -406,6 +414,7 @@ impl Default for WindowConfig { dimensions: Default::default(), padding: default_padding(), decorations: Default::default(), + dynamic_padding: false, } } } -- cgit