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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user