Set default brush size for eraser/blur/jumble to 8px

This commit is contained in:
David Capello 2015-08-11 12:41:56 -03:00
parent 9d84089b0c
commit 8a3434586e
2 changed files with 11 additions and 0 deletions

View File

@ -45,6 +45,9 @@ namespace app {
const char* section() const { return m_section->name(); }
const char* id() const { return m_id; }
const T& defaultValue() const { return m_default; }
void setDefaultValue(const T& defValue) {
m_default = defValue;
}
bool isDirty() const { return m_dirty; }
void forceDirtyFlag() { m_dirty = true; }

View File

@ -13,6 +13,7 @@
#include "app/ini_file.h"
#include "app/pref/preferences.h"
#include "app/resource_finder.h"
#include "app/tools/ink.h"
#include "app/tools/tool.h"
namespace app {
@ -78,6 +79,13 @@ ToolPreferences& Preferences::tool(tools::Tool* tool)
else {
std::string section = std::string("tool.") + tool->getId();
ToolPreferences* toolPref = new ToolPreferences(section);
// Default size for eraser, blur, etc.
if (tool->getInk(0)->isEraser() ||
tool->getInk(0)->isEffect()) {
toolPref->brush.size.setDefaultValue(8);
}
m_tools[tool->getId()] = toolPref;
toolPref->load();
return *toolPref;