ui: added universal font size setting and shortcuts for changing it

This change adds font size and font family to the ApplicationSettings to have a single point for manipulating them. The
font size can also be changed via the menu or the zoomIn and zoomOut shortcuts on all platforms.
This commit is contained in:
Eberhard Graether
2015-07-15 00:38:10 +02:00
parent 7275082284
commit fb170cbd5d
46 changed files with 368 additions and 152 deletions
+15 -1
View File
@@ -14,16 +14,29 @@ bool Settings::load(const std::string& filePath)
if (FileSystem::exists(filePath))
{
m_config = ConfigManager::createAndLoad(TextAccess::createFromFile(filePath));
m_filePath = filePath;
return true;
}
else
{
m_config = ConfigManager::createEmpty();
clear();
LOG_WARNING("File for Settings not found.");
return false;
}
}
void Settings::save()
{
if (m_config.get() && m_filePath.size())
{
m_config->save(m_filePath);
}
else
{
LOG_WARNING("Settings were not saved.");
}
}
void Settings::save(const std::string& filePath)
{
if (m_config)
@@ -39,6 +52,7 @@ void Settings::save(const std::string& filePath)
void Settings::clear()
{
m_config = ConfigManager::createEmpty();
m_filePath.clear();
}
Settings::Settings()