aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-10-28 09:19:48 -0700
committerJoe Wilm <joe@jwilm.com>2016-10-28 09:19:48 -0700
commita81152cc43c12f4232be29798b85ba41fd9482cb (patch)
tree86cb6102af19daaa96b3cbfb1a3ef20af0374f0e /src/config.rs
parent7cd8a6ca12cd37ae354084c7246060219b1e3af8 (diff)
downloadalacritty-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.rs28
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 {