diff options
author | Tuomas Siipola <siiptuo@kapsi.fi> | 2017-05-06 08:45:23 -0700 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-05-06 12:53:54 -0700 |
commit | 9316771f64842533181cfb04a27aa9ae809cc435 (patch) | |
tree | 364cf490246fba9d86bc02ce67aeda43a1610f48 /src/config.rs | |
parent | 149fbaef09a56613c72855bc60355c7848256500 (diff) | |
download | alacritty-9316771f64842533181cfb04a27aa9ae809cc435.tar.gz alacritty-9316771f64842533181cfb04a27aa9ae809cc435.zip |
Add window padding option
Padding can be configured by using the `padding` field in the config
file, like so:
padding:
x: 2
y: 2
which would result in a 2px padding within each side of the window.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 2b46b324..62e0ba49 100644 --- a/src/config.rs +++ b/src/config.rs @@ -182,6 +182,10 @@ pub struct Config { #[serde(default)] dimensions: Dimensions, + /// Pixel padding + #[serde(default="default_padding")] + padding: Delta, + /// Pixels per inch #[serde(default)] dpi: Dpi, @@ -235,6 +239,10 @@ pub struct Config { hide_cursor_when_typing: bool, } +fn default_padding() -> Delta { + Delta { x: 2., y: 2. } +} + #[cfg(not(target_os="macos"))] static DEFAULT_ALACRITTY_CONFIG: &'static str = include_str!("../alacritty.yml"); #[cfg(target_os="macos")] @@ -280,6 +288,7 @@ impl Default for Config { visual_bell: Default::default(), env: Default::default(), hide_cursor_when_typing: Default::default(), + padding: default_padding(), } } } @@ -1008,6 +1017,10 @@ impl Config { &self.selection } + pub fn padding(&self) -> &Delta { + &self.padding + } + #[inline] pub fn draw_bold_text_with_bright_colors(&self) -> bool { self.draw_bold_text_with_bright_colors |