aboutsummaryrefslogtreecommitdiff
path: root/src/Config.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-16 21:22:40 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-16 21:22:40 +0200
commit5ba091235fef86fda675021812eb7559241c1b80 (patch)
tree6c85de6dd29b6ba2bc2ca5f88c518a9001d6d0a4 /src/Config.cpp
parent8574d6c7da09f5d5929df8ff8c35cb4d82389459 (diff)
Allow setting video max height in config
Diffstat (limited to 'src/Config.cpp')
-rw-r--r--src/Config.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index 146527a..f8dc3ed 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -52,6 +52,7 @@ namespace QuickMedia {
if(config_initialized)
return;
+ setlocale(LC_ALL, "C"); // Sigh... stupid C
config_initialized = true;
// Wtf? can't use static non-pointer config because it causes a segfault when setting config.theme.
// It looks like a libc bug??? crashes for both gcc and clang.
@@ -117,6 +118,13 @@ namespace QuickMedia {
config->input.font_size = font_size_json.asDouble();
}
+ const Json::Value &video_json = json_root["video"];
+ if(video_json.isObject()) {
+ const Json::Value &max_height_json = video_json["max_height"];
+ if(max_height_json.isNumeric())
+ config->video.max_height = max_height_json.asInt();
+ }
+
const Json::Value &use_system_fonts_json = json_root["use_system_fonts"];
if(use_system_fonts_json.isBool())
config->use_system_fonts = use_system_fonts_json.asBool();