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

@@ -248,7 +248,7 @@ void TextTool::drawMove(const QPoint& p)
void TextTool::drawStart(const CaptureContext& context)
{
m_color = context.color;
m_size = context.thickness;
m_size = context.toolSize;
emit requestAction(REQ_ADD_CHILD_WIDGET);
}
@@ -265,9 +265,9 @@ void TextTool::onColorChanged(const QColor& c)
}
}
void TextTool::onThicknessChanged(int th)
void TextTool::onSizeChanged(int size)
{
m_size = th;
m_size = size;
m_font.setPointSize(m_size + BASE_POINT_SIZE);
if (m_widget) {
m_widget->setFont(m_font);