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:
+15
-1
@@ -6,6 +6,7 @@
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
#include "utility/scheduling/TaskScheduler.h"
|
||||
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
#include "component/view/MainView.h"
|
||||
#include "component/view/ViewFactory.h"
|
||||
#include "data/StorageCache.h"
|
||||
@@ -31,9 +32,11 @@ std::shared_ptr<Application> Application::create(ViewFactory* viewFactory)
|
||||
void Application::loadSettings()
|
||||
{
|
||||
ApplicationSettings::getInstance()->load("data/ApplicationSettings.xml");
|
||||
GraphViewStyle::loadStyleSettings();
|
||||
}
|
||||
|
||||
Application::Application()
|
||||
: m_isInitialParse(true)
|
||||
{
|
||||
TaskScheduler::getInstance()->startSchedulerLoopThreaded();
|
||||
MessageQueue::getInstance()->setSendMessagesAsTasks(true);
|
||||
@@ -96,11 +99,13 @@ void Application::handleMessage(MessageFinishedParsing* message)
|
||||
{
|
||||
m_project->logStats();
|
||||
|
||||
if (message->errorCount > 0)
|
||||
if (!m_isInitialParse || message->errorCount > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_isInitialParse = false;
|
||||
|
||||
Id mainId = m_storageCache->getIdForNodeWithName("main");
|
||||
|
||||
if (!mainId)
|
||||
@@ -126,17 +131,26 @@ void Application::handleMessage(MessageFinishedParsing* message)
|
||||
|
||||
void Application::handleMessage(MessageLoadProject* message)
|
||||
{
|
||||
m_isInitialParse = true;
|
||||
loadProject(message->projectSettingsFilePath);
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageLoadSource* message)
|
||||
{
|
||||
m_isInitialParse = true;
|
||||
loadSource(message->sourceDirectoryPath);
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageRefresh* message)
|
||||
{
|
||||
loadSettings();
|
||||
|
||||
if (message->uiOnly)
|
||||
{
|
||||
m_componentManager->refreshViews();
|
||||
return;
|
||||
}
|
||||
|
||||
reloadProject();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user