|
|
|
|
@ -44,34 +44,36 @@ void ButtonConfig::acceptActions(ToolHandler* toolHandler) |
|
|
|
|
{ |
|
|
|
|
XOJ_CHECK_TYPE(ButtonConfig); |
|
|
|
|
|
|
|
|
|
if (this->action != TOOL_NONE) |
|
|
|
|
if (this->action == TOOL_NONE) |
|
|
|
|
{ |
|
|
|
|
toolHandler->selectTool(this->action, false); |
|
|
|
|
|
|
|
|
|
if (this->action == TOOL_PEN || this->action == TOOL_HILIGHTER) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this->drawingType != DRAWING_TYPE_DONT_CHANGE) |
|
|
|
|
{ |
|
|
|
|
toolHandler->setDrawingType(this->drawingType); |
|
|
|
|
} |
|
|
|
|
toolHandler->selectTool(this->action, false); |
|
|
|
|
|
|
|
|
|
if (this->size != TOOL_SIZE_NONE) |
|
|
|
|
{ |
|
|
|
|
toolHandler->setSize(this->size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this->action == TOOL_PEN || this->action == TOOL_HILIGHTER) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (this->action == TOOL_PEN || this->action == TOOL_HILIGHTER || this->action == TOOL_TEXT) |
|
|
|
|
if (this->drawingType != DRAWING_TYPE_DONT_CHANGE) |
|
|
|
|
{ |
|
|
|
|
toolHandler->setColor(this->color); |
|
|
|
|
toolHandler->setDrawingType(this->drawingType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this->action == TOOL_ERASER && this->eraserMode != ERASER_TYPE_NONE) |
|
|
|
|
if (this->size != TOOL_SIZE_NONE) |
|
|
|
|
{ |
|
|
|
|
toolHandler->setEraserType(this->eraserMode); |
|
|
|
|
toolHandler->setSize(this->size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toolHandler->fireToolChanged(); |
|
|
|
|
if (this->action == TOOL_PEN || this->action == TOOL_HILIGHTER || this->action == TOOL_TEXT) |
|
|
|
|
{ |
|
|
|
|
toolHandler->setColor(this->color, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this->action == TOOL_ERASER && this->eraserMode != ERASER_TYPE_NONE) |
|
|
|
|
{ |
|
|
|
|
toolHandler->setEraserType(this->eraserMode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toolHandler->fireToolChanged(); |
|
|
|
|
} |
|
|
|
|
|