diff options
author | Joe Wilm <joe@jwilm.com> | 2016-10-28 09:19:48 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-10-28 09:19:48 -0700 |
commit | a81152cc43c12f4232be29798b85ba41fd9482cb (patch) | |
tree | 86cb6102af19daaa96b3cbfb1a3ef20af0374f0e /src/config.rs | |
parent | 7cd8a6ca12cd37ae354084c7246060219b1e3af8 (diff) | |
download | alacritty-a81152cc43c12f4232be29798b85ba41fd9482cb.tar.gz alacritty-a81152cc43c12f4232be29798b85ba41fd9482cb.zip |
Support drawing bold test with bright colors
This feature is on by default
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index f3e68dca..cd6880d7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -15,8 +15,13 @@ use serde_yaml; use serde::{self, Error as SerdeError}; use notify::{Watcher as WatcherApi, RecommendedWatcher as FileWatcher, op}; +/// Function that returns true for serde default +fn true_bool() -> bool { + true +} + /// Top-level config type -#[derive(Debug, Deserialize, Default)] +#[derive(Debug, Deserialize)] pub struct Config { /// Pixels per inch #[serde(default)] @@ -30,11 +35,27 @@ pub struct Config { #[serde(default)] render_timer: bool, + /// Should show render timer + #[serde(default="true_bool")] + draw_bold_text_with_bright_colors: bool, + /// The standard ANSI colors to use #[serde(default)] colors: Colors, } +impl Default for Config { + fn default() -> Config { + Config { + draw_bold_text_with_bright_colors: true, + dpi: Default::default(), + font: Default::default(), + render_timer: Default::default(), + colors: Default::default(), + } + } +} + /// Errors occurring during config loading #[derive(Debug)] pub enum Error { @@ -301,6 +322,11 @@ impl Config { self.colors.primary.background } + #[inline] + pub fn draw_bold_text_with_bright_colors(&self) -> bool { + self.draw_bold_text_with_bright_colors + } + /// Get font config #[inline] pub fn font(&self) -> &Font { |