From 48eeae863e4189fa2ed25d63d092ba16fe1abdfa Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Thu, 23 Jun 2016 23:21:17 -0400 Subject: [PATCH] Save/Load Font Scale with App Config --- src/AppConfig.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/AppConfig.cpp b/src/AppConfig.cpp index 1fb7d99..67ec812 100644 --- a/src/AppConfig.cpp +++ b/src/AppConfig.cpp @@ -86,6 +86,7 @@ void DeviceConfig::save(DataNode *node) { *node->newChild("offset") = offset.load(); *node->newChild("sample_rate") = sampleRate.load(); *node->newChild("agc_mode") = agcMode.load()?1:0; + *node->newChild("font_scale") = GLFont::getScale(); if (streamOpts.size()) { DataNode *streamOptsNode = node->newChild("streamOpts"); @@ -141,6 +142,14 @@ void DeviceConfig::load(DataNode *node) { agc_node->element()->get(agcModeValue); setAGCMode(agcModeValue?true:false); } + if (node->hasAnother("font_scale")) { + DataNode *agc_node = node->getNext("font_scale"); + int fontScaleValue = 0; + agc_node->element()->get(fontScaleValue); + if (fontScaleValue > 0 && fontScaleValue < GLFont::GLFONT_SCALE_MAX) { + GLFont::setScale((GLFont::GLFontScale) fontScaleValue); + } + } if (node->hasAnother("sample_rate")) { DataNode *sample_rate_node = node->getNext("sample_rate"); long sampleRateValue = 0;