Refactor tool size handling (#1969)

* Add ConfigHandler::toolSize and setToolSize

* Refactor thickness (now toolSize) in CaptureWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix update of tool size while object is drawn

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Rename thickness to tool size across the board

Tool size is the generic term. Depending on the selected tool,
different specialized names are used. This has always been the case
in the config.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Reorder circle count tool

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* clang-format

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
Haris Gušić
2021-10-20 00:01:35 +02:00
committed by GitHub
parent 1b40e62b5b
commit 534f05b238
27 changed files with 210 additions and 199 deletions

View File

@@ -46,7 +46,7 @@ bool AbstractPathTool::showMousePreview() const
QRect AbstractPathTool::mousePreviewRect(const CaptureContext& context) const
{
QRect rect(0, 0, context.thickness + 2, context.thickness + 2);
QRect rect(0, 0, context.toolSize + 2, context.toolSize + 2);
rect.moveCenter(context.mousePos);
return rect;
}
@@ -99,9 +99,9 @@ void AbstractPathTool::onColorChanged(const QColor& c)
m_color = c;
}
void AbstractPathTool::onThicknessChanged(int th)
void AbstractPathTool::onSizeChanged(int size)
{
m_thickness = th;
m_thickness = size;
}
void AbstractPathTool::addPoint(const QPoint& point)