From fa815c3eee27cdae69b2e765b03de62a13f6379d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 4 Sep 2021 02:31:10 +0200 Subject: Make font sizes customizable with a config file, see example-config.json. Remove environment variables --- src/Theme.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Theme.cpp') diff --git a/src/Theme.cpp b/src/Theme.cpp index 18581ff..a197848 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -1,4 +1,5 @@ #include "../include/Theme.hpp" +#include "../include/Config.hpp" #include #include #include @@ -76,10 +77,7 @@ namespace QuickMedia { init_theme_dark(); init_theme_nord(); - char *theme = getenv("QM_THEME"); - if(!theme) - return; - + const char *theme = get_config().theme.c_str(); if(strcmp(theme, "default") == 0) current_theme = THEME_DARK; else if(strcmp(theme, "nord") == 0) @@ -92,7 +90,7 @@ namespace QuickMedia { current_theme = theme; } - Theme& get_current_theme() { + const Theme& get_current_theme() { assert(themes_initialized); return themes[current_theme]; } -- cgit v1.2.3