aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
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 {