Skip to content

Commit

Permalink
Set default brush size for eraser/blur/jumble to 8px
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Aug 11, 2015
1 parent 9d84089 commit 8a34345
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/pref/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
8 changes: 8 additions & 0 deletions src/app/pref/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8a34345

Please sign in to comment.