Put all colors into single xml file. Accessing colors is handled via the singleton class ColorScheme. The default scheme "bright.xml" holds the original colors. The scheme "dark.xml" is a start, but still a poor alternative. Color schemes can be switched via the View menu.
92 lines
2.1 KiB
C++
92 lines
2.1 KiB
C++
#include "settings/ApplicationSettings.h"
|
|
|
|
std::shared_ptr<ApplicationSettings> ApplicationSettings::s_instance;
|
|
|
|
std::shared_ptr<ApplicationSettings> ApplicationSettings::getInstance()
|
|
{
|
|
if (!s_instance)
|
|
{
|
|
s_instance = std::shared_ptr<ApplicationSettings>(new ApplicationSettings());
|
|
}
|
|
|
|
return s_instance;
|
|
}
|
|
|
|
ApplicationSettings::~ApplicationSettings()
|
|
{
|
|
}
|
|
|
|
std::string ApplicationSettings::getStartupProjectFilePath() const
|
|
{
|
|
return getValue<std::string>("StartupProject", "");
|
|
}
|
|
|
|
bool ApplicationSettings::filterUndefinedNodesFromGraph() const
|
|
{
|
|
return getValue<bool>("FilterUndefinedNodesFromGraph", false);
|
|
}
|
|
|
|
std::string ApplicationSettings::getFontName() const
|
|
{
|
|
return getValue<std::string>("application/font_name", "Source Code Pro");
|
|
}
|
|
|
|
void ApplicationSettings::setFontName(const std::string& fontName)
|
|
{
|
|
setValue<std::string>("application/font_name", fontName);
|
|
}
|
|
|
|
int ApplicationSettings::getFontSize() const
|
|
{
|
|
return getValue<int>("application/font_size", 14);
|
|
}
|
|
|
|
void ApplicationSettings::setFontSize(int fontSize)
|
|
{
|
|
setValue<int>("application/font_size", fontSize);
|
|
}
|
|
|
|
std::string ApplicationSettings::getColorSchemePath() const
|
|
{
|
|
return getValue<std::string>("application/color_scheme", "./data/color_schemes/bright.xml");
|
|
}
|
|
|
|
void ApplicationSettings::setColorSchemePath(const std::string& colorSchemePath)
|
|
{
|
|
setValue<std::string>("application/color_scheme", colorSchemePath);
|
|
}
|
|
|
|
int ApplicationSettings::getCodeTabWidth() const
|
|
{
|
|
return getValue<int>("code/TabWidth", 4);
|
|
}
|
|
|
|
void ApplicationSettings::setCodeTabWidth(int codeTabWidth)
|
|
{
|
|
setValue<int>("code/TabWidth", codeTabWidth);
|
|
}
|
|
|
|
int ApplicationSettings::getCodeSnippetSnapRange() const
|
|
{
|
|
return getValue<int>("code/snippet/snap_range", 4);
|
|
}
|
|
|
|
void ApplicationSettings::setCodeSnippetSnapRange(int range)
|
|
{
|
|
setValue<int>("code/snippet/snap_range", range);
|
|
}
|
|
|
|
int ApplicationSettings::getCodeSnippetExpandRange() const
|
|
{
|
|
return getValue<int>("code/snippet/expand_range", 2);
|
|
}
|
|
|
|
void ApplicationSettings::setCodeSnippetExpandRange(int range)
|
|
{
|
|
setValue<int>("code/snippet/expand_range", range);
|
|
}
|
|
|
|
ApplicationSettings::ApplicationSettings()
|
|
{
|
|
}
|