mirror of
https://github.com/flameshot-org/flameshot.git
synced 2026-12-04 06:54:50 +00:00
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:
@@ -212,9 +212,8 @@ void ShortcutsWidget::initShortcuts()
|
||||
#endif
|
||||
m_shortcuts << (QStringList()
|
||||
<< "" << QObject::tr("Show color picker") << "Right Click");
|
||||
m_shortcuts << (QStringList()
|
||||
<< "" << QObject::tr("Change the tool's thickness")
|
||||
<< "Mouse Wheel");
|
||||
m_shortcuts << (QStringList() << "" << QObject::tr("Change the tool's size")
|
||||
<< "Mouse Wheel");
|
||||
}
|
||||
|
||||
void ShortcutsWidget::appendShortcut(const QString& shortcutName,
|
||||
|
||||
@@ -60,7 +60,7 @@ void AbstractActionTool::onColorChanged(const QColor& c)
|
||||
Q_UNUSED(c)
|
||||
}
|
||||
|
||||
void AbstractActionTool::onThicknessChanged(int th)
|
||||
void AbstractActionTool::onSizeChanged(int size)
|
||||
{
|
||||
Q_UNUSED(th)
|
||||
Q_UNUSED(size)
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ public slots:
|
||||
void drawMove(const QPoint& p) override;
|
||||
void drawStart(const CaptureContext& context) override;
|
||||
void onColorChanged(const QColor& c) override;
|
||||
void onThicknessChanged(int th) override;
|
||||
void onSizeChanged(int size) override;
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -19,13 +19,13 @@ public:
|
||||
QRect boundingRect() const override;
|
||||
void move(const QPoint& mousePos) override;
|
||||
const QPoint* pos() override;
|
||||
int thickness() const override { return m_thickness; };
|
||||
int size() const override { return m_thickness; };
|
||||
|
||||
public slots:
|
||||
void drawEnd(const QPoint& p) override;
|
||||
void drawMove(const QPoint& p) override;
|
||||
void onColorChanged(const QColor& c) override;
|
||||
void onThicknessChanged(int th) override;
|
||||
void onSizeChanged(int size) override;
|
||||
|
||||
protected:
|
||||
void copyParams(const AbstractPathTool* from, AbstractPathTool* to);
|
||||
|
||||
@@ -70,7 +70,7 @@ bool AbstractTwoPointTool::showMousePreview() const
|
||||
QRect AbstractTwoPointTool::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;
|
||||
}
|
||||
@@ -111,15 +111,15 @@ void AbstractTwoPointTool::onColorChanged(const QColor& c)
|
||||
m_color = c;
|
||||
}
|
||||
|
||||
void AbstractTwoPointTool::onThicknessChanged(int th)
|
||||
void AbstractTwoPointTool::onSizeChanged(int size)
|
||||
{
|
||||
m_thickness = th;
|
||||
m_thickness = size;
|
||||
}
|
||||
|
||||
void AbstractTwoPointTool::paintMousePreview(QPainter& painter,
|
||||
const CaptureContext& context)
|
||||
{
|
||||
painter.setPen(QPen(context.color, context.thickness));
|
||||
painter.setPen(QPen(context.color, context.toolSize));
|
||||
painter.drawLine(context.mousePos, context.mousePos);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void AbstractTwoPointTool::drawStart(const CaptureContext& context)
|
||||
onColorChanged(context.color);
|
||||
m_points.first = context.mousePos;
|
||||
m_points.second = context.mousePos;
|
||||
onThicknessChanged(context.thickness);
|
||||
onSizeChanged(context.toolSize);
|
||||
}
|
||||
|
||||
QPoint AbstractTwoPointTool::adjustedVector(QPoint v) const
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
QRect boundingRect() const override;
|
||||
void move(const QPoint& pos) override;
|
||||
const QPoint* pos() override;
|
||||
int thickness() const override { return m_thickness; };
|
||||
int size() const override { return m_thickness; };
|
||||
const QColor& color() { return m_color; };
|
||||
const QPair<QPoint, QPoint> points() const { return m_points; };
|
||||
void paintMousePreview(QPainter& painter,
|
||||
@@ -30,7 +30,7 @@ public slots:
|
||||
void drawMove(const QPoint& p) override;
|
||||
void drawMoveWithAdjustment(const QPoint& p) override;
|
||||
void onColorChanged(const QColor& c) override;
|
||||
void onThicknessChanged(int th) override;
|
||||
void onSizeChanged(int size) override;
|
||||
virtual void drawStart(const CaptureContext& context) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -88,8 +88,7 @@ QRect ArrowTool::boundingRect() const
|
||||
return {};
|
||||
}
|
||||
|
||||
int offset =
|
||||
thickness() <= 1 ? 1 : static_cast<int>(round(thickness() / 2 + 0.5));
|
||||
int offset = size() <= 1 ? 1 : static_cast<int>(round(size() / 2 + 0.5));
|
||||
|
||||
// get min and max arrow pos
|
||||
int min_x = points().first.x();
|
||||
@@ -146,10 +145,9 @@ void ArrowTool::copyParams(const ArrowTool* from, ArrowTool* to)
|
||||
void ArrowTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
{
|
||||
Q_UNUSED(pixmap)
|
||||
painter.setPen(QPen(color(), thickness()));
|
||||
painter.drawLine(
|
||||
getShorterLine(points().first, points().second, thickness()));
|
||||
m_arrowPath = getArrowHead(points().first, points().second, thickness());
|
||||
painter.setPen(QPen(color(), size()));
|
||||
painter.drawLine(getShorterLine(points().first, points().second, size()));
|
||||
m_arrowPath = getArrowHead(points().first, points().second, size());
|
||||
painter.fillPath(m_arrowPath, QBrush(color()));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ struct CaptureContext
|
||||
QPoint widgetOffset;
|
||||
// Mouse position inside the widget
|
||||
QPoint mousePos;
|
||||
// Value of the desired thickness
|
||||
int thickness;
|
||||
// Size of the active tool
|
||||
int toolSize;
|
||||
// Mode of the capture widget
|
||||
bool fullscreen;
|
||||
uint requestId;
|
||||
|
||||
@@ -193,9 +193,9 @@ public slots:
|
||||
virtual void pressed(CaptureContext& context) = 0;
|
||||
// Called when the color is changed in the editor.
|
||||
virtual void onColorChanged(const QColor& c) = 0;
|
||||
// Called when the thickness of the tool is updated in the editor.
|
||||
virtual void onThicknessChanged(int th) = 0;
|
||||
virtual int thickness() const { return -1; };
|
||||
// Called when the size the tool size is changed by the user.
|
||||
virtual void onSizeChanged(int size) = 0;
|
||||
virtual int size() const { return -1; };
|
||||
|
||||
private:
|
||||
unsigned int m_count;
|
||||
|
||||
@@ -40,7 +40,7 @@ CaptureTool* CircleTool::copy(QObject* parent)
|
||||
void CircleTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
{
|
||||
Q_UNUSED(pixmap)
|
||||
painter.setPen(QPen(color(), thickness()));
|
||||
painter.setPen(QPen(color(), size()));
|
||||
painter.drawEllipse(QRect(points().first, points().second));
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ bool CircleCountTool::isValid() const
|
||||
|
||||
QRect CircleCountTool::mousePreviewRect(const CaptureContext& context) const
|
||||
{
|
||||
int width = (context.thickness + THICKNESS_OFFSET) * 2;
|
||||
int width = (context.toolSize + THICKNESS_OFFSET) * 2;
|
||||
QRect rect(0, 0, width, width);
|
||||
rect.moveCenter(context.mousePos);
|
||||
return rect;
|
||||
@@ -47,7 +47,7 @@ QRect CircleCountTool::boundingRect() const
|
||||
if (!isValid()) {
|
||||
return {};
|
||||
}
|
||||
int bubble_size = thickness() + THICKNESS_OFFSET + PADDING_VALUE;
|
||||
int bubble_size = size() + THICKNESS_OFFSET + PADDING_VALUE;
|
||||
return QRect(points().first.x() - bubble_size,
|
||||
points().first.y() - bubble_size,
|
||||
bubble_size * 2,
|
||||
@@ -97,7 +97,7 @@ void CircleCountTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
QColor antiContrastColor =
|
||||
ColorUtils::colorIsDark(color()) ? Qt::black : Qt::white;
|
||||
|
||||
int bubble_size = thickness() + THICKNESS_OFFSET;
|
||||
int bubble_size = size() + THICKNESS_OFFSET;
|
||||
painter.setPen(contrastColor);
|
||||
painter.setBrush(antiContrastColor);
|
||||
painter.drawEllipse(
|
||||
@@ -143,7 +143,7 @@ void CircleCountTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
void CircleCountTool::paintMousePreview(QPainter& painter,
|
||||
const CaptureContext& context)
|
||||
{
|
||||
onThicknessChanged(context.thickness + PADDING_VALUE);
|
||||
onSizeChanged(context.toolSize + PADDING_VALUE);
|
||||
|
||||
// Thickness for pen is *2 to range from radius to diameter to match the
|
||||
// ellipse draw function
|
||||
@@ -151,7 +151,7 @@ void CircleCountTool::paintMousePreview(QPainter& painter,
|
||||
auto orig_opacity = painter.opacity();
|
||||
painter.setOpacity(0.35);
|
||||
painter.setPen(QPen(context.color,
|
||||
(thickness() + THICKNESS_OFFSET) * 2,
|
||||
(size() + THICKNESS_OFFSET) * 2,
|
||||
Qt::SolidLine,
|
||||
Qt::RoundCap));
|
||||
painter.drawLine(context.mousePos,
|
||||
|
||||
@@ -42,7 +42,7 @@ CaptureTool* LineTool::copy(QObject* parent)
|
||||
void LineTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
{
|
||||
Q_UNUSED(pixmap)
|
||||
painter.setPen(QPen(color(), thickness()));
|
||||
painter.setPen(QPen(color(), size()));
|
||||
painter.drawLine(points().first, points().second);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ QString MarkerTool::description() const
|
||||
|
||||
QRect MarkerTool::mousePreviewRect(const CaptureContext& context) const
|
||||
{
|
||||
int width = PADDING_VALUE + context.thickness;
|
||||
int width = PADDING_VALUE + context.toolSize;
|
||||
QRect rect(0, 0, width + 2, width + 2);
|
||||
rect.moveCenter(context.mousePos);
|
||||
return rect;
|
||||
@@ -56,7 +56,7 @@ void MarkerTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
auto pen = painter.pen();
|
||||
painter.setCompositionMode(QPainter::CompositionMode_Multiply);
|
||||
painter.setOpacity(0.35);
|
||||
painter.setPen(QPen(color(), thickness()));
|
||||
painter.setPen(QPen(color(), size()));
|
||||
painter.drawLine(points().first, points().second);
|
||||
painter.setPen(pen);
|
||||
painter.setOpacity(opacity);
|
||||
@@ -71,7 +71,7 @@ void MarkerTool::paintMousePreview(QPainter& painter,
|
||||
auto pen = painter.pen();
|
||||
painter.setCompositionMode(QPainter::CompositionMode_Multiply);
|
||||
painter.setOpacity(0.35);
|
||||
painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness));
|
||||
painter.setPen(QPen(context.color, PADDING_VALUE + context.toolSize));
|
||||
painter.drawLine(context.mousePos, context.mousePos);
|
||||
painter.setPen(pen);
|
||||
painter.setOpacity(opacity);
|
||||
@@ -81,7 +81,7 @@ void MarkerTool::paintMousePreview(QPainter& painter,
|
||||
void MarkerTool::drawStart(const CaptureContext& context)
|
||||
{
|
||||
AbstractTwoPointTool::drawStart(context);
|
||||
onThicknessChanged(context.thickness + PADDING_VALUE);
|
||||
onSizeChanged(context.toolSize + PADDING_VALUE);
|
||||
}
|
||||
|
||||
void MarkerTool::pressed(CaptureContext& context)
|
||||
|
||||
@@ -38,21 +38,21 @@ CaptureTool* PencilTool::copy(QObject* parent)
|
||||
void PencilTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
{
|
||||
Q_UNUSED(pixmap)
|
||||
painter.setPen(QPen(m_color, thickness()));
|
||||
painter.setPen(QPen(m_color, size()));
|
||||
painter.drawPolyline(m_points.data(), m_points.size());
|
||||
}
|
||||
|
||||
void PencilTool::paintMousePreview(QPainter& painter,
|
||||
const CaptureContext& context)
|
||||
{
|
||||
painter.setPen(QPen(context.color, context.thickness + 2));
|
||||
painter.setPen(QPen(context.color, context.toolSize + 2));
|
||||
painter.drawLine(context.mousePos, context.mousePos);
|
||||
}
|
||||
|
||||
void PencilTool::drawStart(const CaptureContext& context)
|
||||
{
|
||||
m_color = context.color;
|
||||
onThicknessChanged(context.thickness);
|
||||
onSizeChanged(context.toolSize);
|
||||
m_points.append(context.mousePos);
|
||||
m_pathArea.setTopLeft(context.mousePos);
|
||||
m_pathArea.setBottomRight(context.mousePos);
|
||||
|
||||
@@ -54,7 +54,7 @@ void PixelateTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
selection.bottomRight() * pixelRatio);
|
||||
|
||||
// If thickness is less than 1, use old blur process
|
||||
if (thickness() <= 1) {
|
||||
if (size() <= 1) {
|
||||
QGraphicsBlurEffect* blur = new QGraphicsBlurEffect;
|
||||
blur->setBlurRadius(10);
|
||||
QGraphicsPixmapItem* item =
|
||||
@@ -70,10 +70,10 @@ void PixelateTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
scene.render(&painter, selection, QRectF());
|
||||
|
||||
} else {
|
||||
int width = static_cast<int>(selection.width() *
|
||||
(0.5 / qMax(1, thickness() + 1)));
|
||||
int height = static_cast<int>(selection.height() *
|
||||
(0.5 / qMax(1, thickness() + 1)));
|
||||
int width =
|
||||
static_cast<int>(selection.width() * (0.5 / qMax(1, size() + 1)));
|
||||
int height =
|
||||
static_cast<int>(selection.height() * (0.5 / qMax(1, size() + 1)));
|
||||
QSize size = QSize(qMax(width, 1), qMax(height, 1));
|
||||
|
||||
QPixmap t = pixmap.copy(selectionScaled);
|
||||
|
||||
@@ -45,22 +45,22 @@ void RectangleTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
QPen orig_pen = painter.pen();
|
||||
QBrush orig_brush = painter.brush();
|
||||
painter.setPen(
|
||||
QPen(color(), thickness(), Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin));
|
||||
QPen(color(), size(), Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin));
|
||||
painter.setBrush(QBrush(color()));
|
||||
if (thickness() == 0) {
|
||||
if (size() == 0) {
|
||||
painter.drawRect(QRect(points().first, points().second));
|
||||
} else {
|
||||
QPainterPath path;
|
||||
int offset =
|
||||
thickness() <= 1 ? 1 : static_cast<int>(round(thickness() / 2 + 0.5));
|
||||
size() <= 1 ? 1 : static_cast<int>(round(size() / 2 + 0.5));
|
||||
path.addRoundedRect(
|
||||
QRectF(
|
||||
std::min(points().first.x(), points().second.x()) - offset,
|
||||
std::min(points().first.y(), points().second.y()) - offset,
|
||||
std::abs(points().first.x() - points().second.x()) + offset * 2,
|
||||
std::abs(points().first.y() - points().second.y()) + offset * 2),
|
||||
thickness(),
|
||||
thickness());
|
||||
size(),
|
||||
size());
|
||||
painter.fillPath(path, color());
|
||||
}
|
||||
painter.setPen(orig_pen);
|
||||
@@ -70,7 +70,7 @@ void RectangleTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
void RectangleTool::drawStart(const CaptureContext& context)
|
||||
{
|
||||
AbstractTwoPointTool::drawStart(context);
|
||||
onThicknessChanged(context.thickness);
|
||||
onSizeChanged(context.toolSize);
|
||||
}
|
||||
|
||||
void RectangleTool::pressed(CaptureContext& context)
|
||||
|
||||
@@ -46,7 +46,7 @@ void SelectionTool::process(QPainter& painter, const QPixmap& pixmap)
|
||||
{
|
||||
Q_UNUSED(pixmap)
|
||||
painter.setPen(
|
||||
QPen(color(), thickness(), Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin));
|
||||
QPen(color(), size(), Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin));
|
||||
painter.drawRect(QRect(points().first, points().second));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -52,8 +52,8 @@ public slots:
|
||||
void drawStart(const CaptureContext& context) override;
|
||||
void pressed(CaptureContext& context) override;
|
||||
void onColorChanged(const QColor& c) override;
|
||||
void onThicknessChanged(int th) override;
|
||||
virtual int thickness() const override { return m_size; };
|
||||
void onSizeChanged(int size) override;
|
||||
virtual int size() const override { return m_size; };
|
||||
|
||||
private slots:
|
||||
void updateText(const QString& s);
|
||||
|
||||
@@ -104,13 +104,15 @@ static QMap<class QString, QSharedPointer<ValueHandler>>
|
||||
OPTION("filenamePattern" ,FilenamePattern ( {} )),
|
||||
// Others
|
||||
OPTION("drawThickness" ,LowerBoundedInt(1 , 3 )),
|
||||
OPTION("drawFontSize" ,LowerBoundedInt(1 , 8 )),
|
||||
OPTION("drawColor" ,Color ( Qt::red )),
|
||||
OPTION("userColors" ,UserColors ( )),
|
||||
OPTION("drawFontSize" ,LowerBoundedInt(1 , 8 )),
|
||||
OPTION("ignoreUpdateToVersion" ,String ( "" )),
|
||||
OPTION("keepOpenAppLauncher" ,Bool ( false )),
|
||||
OPTION("fontFamily" ,String ( "" )),
|
||||
OPTION("setSaveAsFileExtension" ,String ( "" )),
|
||||
// NOTE: If another tool size is added besides drawThickness and
|
||||
// drawFontSize, remember to update ConfigHandler::toolSize
|
||||
};
|
||||
|
||||
static QMap<QString, QSharedPointer<KeySequence>> recognizedShortcuts = {
|
||||
@@ -316,6 +318,24 @@ void ConfigHandler::setAllTheButtons()
|
||||
setValue(QStringLiteral("buttons"), QVariant::fromValue(buttons));
|
||||
}
|
||||
|
||||
void ConfigHandler::setToolSize(CaptureTool::Type toolType, int size)
|
||||
{
|
||||
if (toolType == CaptureTool::TYPE_TEXT) {
|
||||
setDrawFontSize(size);
|
||||
} else if (toolType != CaptureTool::NONE) {
|
||||
setDrawThickness(size);
|
||||
}
|
||||
}
|
||||
|
||||
int ConfigHandler::toolSize(CaptureTool::Type toolType)
|
||||
{
|
||||
if (toolType == CaptureTool::TYPE_TEXT) {
|
||||
return drawFontSize();
|
||||
} else {
|
||||
return drawThickness();
|
||||
}
|
||||
}
|
||||
|
||||
// DEFAULTS
|
||||
|
||||
QString ConfigHandler::filenamePatternDefault()
|
||||
|
||||
@@ -101,6 +101,8 @@ public:
|
||||
QString saveAsFileExtension();
|
||||
CONFIG_SETTER(setSaveAsFileExtension, setSaveAsFileExtension, QString)
|
||||
void setAllTheButtons();
|
||||
void setToolSize(CaptureTool::Type toolType, int size);
|
||||
int toolSize(CaptureTool::Type toolType);
|
||||
|
||||
// DEFAULTS
|
||||
QString filenamePatternDefault();
|
||||
|
||||
@@ -163,30 +163,19 @@ int CaptureToolButton::getPriorityByButton(CaptureTool::Type b)
|
||||
}
|
||||
|
||||
QList<CaptureTool::Type> CaptureToolButton::iterableButtonTypes = {
|
||||
CaptureTool::TYPE_PENCIL,
|
||||
CaptureTool::TYPE_DRAWER,
|
||||
CaptureTool::TYPE_ARROW,
|
||||
CaptureTool::TYPE_SELECTION,
|
||||
CaptureTool::TYPE_RECTANGLE,
|
||||
CaptureTool::TYPE_CIRCLE,
|
||||
CaptureTool::TYPE_MARKER,
|
||||
CaptureTool::TYPE_TEXT,
|
||||
CaptureTool::TYPE_PIXELATE,
|
||||
CaptureTool::TYPE_INVERT,
|
||||
CaptureTool::TYPE_SELECTIONINDICATOR,
|
||||
CaptureTool::TYPE_MOVESELECTION,
|
||||
CaptureTool::TYPE_UNDO,
|
||||
CaptureTool::TYPE_REDO,
|
||||
CaptureTool::TYPE_COPY,
|
||||
CaptureTool::TYPE_SAVE,
|
||||
CaptureTool::TYPE_EXIT,
|
||||
CaptureTool::TYPE_PENCIL, CaptureTool::TYPE_DRAWER,
|
||||
CaptureTool::TYPE_ARROW, CaptureTool::TYPE_SELECTION,
|
||||
CaptureTool::TYPE_RECTANGLE, CaptureTool::TYPE_CIRCLE,
|
||||
CaptureTool::TYPE_MARKER, CaptureTool::TYPE_TEXT,
|
||||
CaptureTool::TYPE_CIRCLECOUNT, CaptureTool::TYPE_PIXELATE,
|
||||
CaptureTool::TYPE_INVERT, CaptureTool::TYPE_SELECTIONINDICATOR,
|
||||
CaptureTool::TYPE_MOVESELECTION, CaptureTool::TYPE_UNDO,
|
||||
CaptureTool::TYPE_REDO, CaptureTool::TYPE_COPY,
|
||||
CaptureTool::TYPE_SAVE, CaptureTool::TYPE_EXIT,
|
||||
CaptureTool::TYPE_IMAGEUPLOADER,
|
||||
#if !defined(Q_OS_MACOS)
|
||||
CaptureTool::TYPE_OPEN_APP,
|
||||
#endif
|
||||
CaptureTool::TYPE_PIN,
|
||||
CaptureTool::TYPE_CIRCLECOUNT,
|
||||
CaptureTool::TYPE_SIZEINCREASE,
|
||||
CaptureTool::TYPE_SIZEDECREASE,
|
||||
CaptureTool::TYPE_ACCEPT,
|
||||
CaptureTool::TYPE_PIN, CaptureTool::TYPE_SIZEINCREASE,
|
||||
CaptureTool::TYPE_SIZEDECREASE, CaptureTool::TYPE_ACCEPT,
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ CaptureWidget::CaptureWidget(uint id,
|
||||
, m_selection(nullptr)
|
||||
, m_existingObjectIsChanged(false)
|
||||
, m_startMove(false)
|
||||
, m_thicknessByKeyboard(0)
|
||||
, m_toolSizeByKeyboard(0)
|
||||
{
|
||||
m_undoStack.setUndoLimit(ConfigHandler().undoLimit());
|
||||
|
||||
@@ -190,14 +190,21 @@ CaptureWidget::CaptureWidget(uint id,
|
||||
});
|
||||
m_colorPicker->hide();
|
||||
|
||||
// Init tool size sigslots
|
||||
connect(this,
|
||||
&CaptureWidget::toolSizeChanged,
|
||||
this,
|
||||
&CaptureWidget::onToolSizeChanged);
|
||||
|
||||
// Init notification widget
|
||||
m_notifierBox = new NotifierBox(this);
|
||||
m_notifierBox->hide();
|
||||
connect(m_notifierBox, &NotifierBox::hidden, this, [this]() {
|
||||
// Show cursor if it was hidden while adjusting tool thickness
|
||||
// Show cursor if it was hidden while adjusting tool size
|
||||
updateCursor();
|
||||
m_thicknessByKeyboard = 0;
|
||||
setDrawThickness(m_context.thickness);
|
||||
m_toolSizeByKeyboard = 0;
|
||||
onToolSizeChanged(m_context.toolSize);
|
||||
onToolSizeSettled(m_context.toolSize);
|
||||
});
|
||||
|
||||
initPanel();
|
||||
@@ -498,9 +505,9 @@ bool CaptureWidget::startDrawObjectTool(const QPoint& pos)
|
||||
m_activeTool,
|
||||
&CaptureTool::onColorChanged);
|
||||
connect(this,
|
||||
&CaptureWidget::thicknessChanged,
|
||||
&CaptureWidget::toolSizeChanged,
|
||||
m_activeTool,
|
||||
&CaptureTool::onThicknessChanged);
|
||||
&CaptureTool::onSizeChanged);
|
||||
connect(m_activeTool,
|
||||
&CaptureTool::requestAction,
|
||||
this,
|
||||
@@ -544,11 +551,11 @@ int CaptureWidget::selectToolItemAtPos(const QPoint& pos)
|
||||
if (!toolItem ||
|
||||
(toolItem && !toolItem->boundingRect().contains(pos))) {
|
||||
activeLayerIndex = m_captureToolObjects.find(pos, size());
|
||||
int thickness_old = m_context.thickness;
|
||||
int oldToolSize = m_context.toolSize;
|
||||
m_panel->setActiveLayer(activeLayerIndex);
|
||||
drawObjectSelection();
|
||||
if (thickness_old != m_context.thickness) {
|
||||
emit thicknessChanged(m_context.thickness);
|
||||
if (oldToolSize != m_context.toolSize) {
|
||||
emit toolSizeChanged(m_context.toolSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -732,50 +739,43 @@ void CaptureWidget::mouseReleaseEvent(QMouseEvent* e)
|
||||
updateCursor();
|
||||
}
|
||||
|
||||
void CaptureWidget::updateThickness(int thickness)
|
||||
/**
|
||||
* Was updateThickness.
|
||||
* - Update tool mouse preview
|
||||
* - Show notifier box displaying the new thickness
|
||||
* - Update selected object thickness
|
||||
*/
|
||||
void CaptureWidget::setToolSize(int size)
|
||||
{
|
||||
auto tool = activeButtonTool();
|
||||
updateTool(tool);
|
||||
m_context.thickness = qBound(1, thickness, maxDrawThickness);
|
||||
int oldSize = m_context.toolSize;
|
||||
m_context.toolSize = qBound(1, size, maxToolSize);
|
||||
updateTool(activeButtonTool());
|
||||
|
||||
QPoint topLeft =
|
||||
QGuiAppCurrentScreen().currentScreen()->geometry().topLeft();
|
||||
int offset = m_notifierBox->width() / 4;
|
||||
m_notifierBox->move(mapFromGlobal(topLeft) + QPoint(offset, offset));
|
||||
m_notifierBox->showMessage(QString::number(m_context.thickness));
|
||||
m_notifierBox->showMessage(QString::number(m_context.toolSize));
|
||||
|
||||
if (tool && tool->showMousePreview()) {
|
||||
setCursor(Qt::BlankCursor);
|
||||
updateTool(tool);
|
||||
if (m_context.toolSize != oldSize) {
|
||||
emit toolSizeChanged(m_context.toolSize);
|
||||
}
|
||||
|
||||
// update selected object thickness
|
||||
auto toolItem = activeToolObject();
|
||||
if (toolItem) {
|
||||
toolItem->onThicknessChanged(m_context.thickness);
|
||||
if (!m_existingObjectIsChanged) {
|
||||
m_captureToolObjectsBackup = m_captureToolObjects;
|
||||
m_existingObjectIsChanged = true;
|
||||
}
|
||||
setDrawThickness(m_context.thickness);
|
||||
}
|
||||
emit thicknessChanged(m_context.thickness);
|
||||
}
|
||||
|
||||
void CaptureWidget::keyPressEvent(QKeyEvent* e)
|
||||
{
|
||||
// If the key is a digit, change the thickness
|
||||
// If the key is a digit, change the tool size
|
||||
bool ok;
|
||||
int digit = e->text().toInt(&ok);
|
||||
if (ok && e->modifiers() == Qt::NoModifier) { // digit received
|
||||
m_thicknessByKeyboard = 10 * m_thicknessByKeyboard + digit;
|
||||
updateThickness(m_thicknessByKeyboard);
|
||||
if (m_context.thickness != m_thicknessByKeyboard) {
|
||||
// The thickness was out of range and was clipped by updateThickness
|
||||
m_thicknessByKeyboard = 0;
|
||||
m_toolSizeByKeyboard = 10 * m_toolSizeByKeyboard + digit;
|
||||
setToolSize(m_toolSizeByKeyboard);
|
||||
if (m_context.toolSize != m_toolSizeByKeyboard) {
|
||||
// The tool size was out of range and was clipped by setToolSize
|
||||
m_toolSizeByKeyboard = 0;
|
||||
}
|
||||
} else {
|
||||
m_thicknessByKeyboard = 0;
|
||||
m_toolSizeByKeyboard = 0;
|
||||
}
|
||||
|
||||
if (!m_selection->isVisible()) {
|
||||
@@ -808,21 +808,21 @@ void CaptureWidget::wheelEvent(QWheelEvent* e)
|
||||
* impossible to scroll. It's easier to calculate number of requests and do
|
||||
* not accept events faster that one in 200ms.
|
||||
* */
|
||||
int thicknessOffset = 0;
|
||||
int toolSizeOffset = 0;
|
||||
if (e->angleDelta().y() >= 60) {
|
||||
// mouse scroll (wheel) increment
|
||||
thicknessOffset = 1;
|
||||
toolSizeOffset = 1;
|
||||
} else if (e->angleDelta().y() <= -60) {
|
||||
// mouse scroll (wheel) decrement
|
||||
thicknessOffset = -1;
|
||||
toolSizeOffset = -1;
|
||||
} else {
|
||||
// touchpad scroll
|
||||
qint64 current = QDateTime::currentMSecsSinceEpoch();
|
||||
if ((current - m_lastMouseWheel) > 200) {
|
||||
if (e->angleDelta().y() > 0) {
|
||||
thicknessOffset = 1;
|
||||
toolSizeOffset = 1;
|
||||
} else if (e->angleDelta().y() < 0) {
|
||||
thicknessOffset = -1;
|
||||
toolSizeOffset = -1;
|
||||
}
|
||||
m_lastMouseWheel = current;
|
||||
} else {
|
||||
@@ -830,7 +830,7 @@ void CaptureWidget::wheelEvent(QWheelEvent* e)
|
||||
}
|
||||
}
|
||||
|
||||
updateThickness(m_context.thickness + thicknessOffset);
|
||||
setToolSize(m_context.toolSize + toolSizeOffset);
|
||||
}
|
||||
|
||||
void CaptureWidget::resizeEvent(QResizeEvent* e)
|
||||
@@ -864,7 +864,7 @@ void CaptureWidget::initContext(bool fullscreen, uint requestId)
|
||||
m_context.color = m_config.drawColor();
|
||||
m_context.widgetOffset = mapToGlobal(QPoint(0, 0));
|
||||
m_context.mousePos = mapFromGlobal(QCursor::pos());
|
||||
m_context.thickness = m_config.drawThickness();
|
||||
m_context.toolSize = m_config.drawThickness();
|
||||
m_context.fullscreen = fullscreen;
|
||||
|
||||
// initialize m_context.request
|
||||
@@ -947,23 +947,24 @@ void CaptureWidget::initPanel()
|
||||
this,
|
||||
&CaptureWidget::setDrawColor);
|
||||
connect(m_sidePanel,
|
||||
&SidePanelWidget::thicknessChanged,
|
||||
&SidePanelWidget::toolSizeChanged,
|
||||
this,
|
||||
&CaptureWidget::setDrawThickness);
|
||||
&CaptureWidget::onToolSizeChanged);
|
||||
connect(this,
|
||||
&CaptureWidget::colorChanged,
|
||||
m_sidePanel,
|
||||
&SidePanelWidget::onColorChanged);
|
||||
connect(this,
|
||||
&CaptureWidget::thicknessChanged,
|
||||
&CaptureWidget::toolSizeChanged,
|
||||
m_sidePanel,
|
||||
&SidePanelWidget::updateThickness);
|
||||
&SidePanelWidget::onToolSizeChanged);
|
||||
connect(m_sidePanel,
|
||||
&SidePanelWidget::togglePanel,
|
||||
m_panel,
|
||||
&UtilityPanel::toggle);
|
||||
// TODO replace with a CaptureWidget signal
|
||||
emit m_sidePanel->colorChanged(m_context.color);
|
||||
emit m_sidePanel->thicknessChanged(m_context.thickness);
|
||||
emit toolSizeChanged(m_context.toolSize);
|
||||
m_panel->pushWidget(m_sidePanel);
|
||||
|
||||
// Fill undo/redo/history list widget
|
||||
@@ -1070,24 +1071,14 @@ void CaptureWidget::setState(CaptureToolButton* b)
|
||||
m_activeButton->setColor(m_uiColor);
|
||||
m_activeButton = nullptr;
|
||||
}
|
||||
loadDrawThickness();
|
||||
m_context.toolSize = ConfigHandler().toolSize(activeButtonToolType());
|
||||
emit toolSizeChanged(m_context.toolSize);
|
||||
updateCursor();
|
||||
updateSelectionState();
|
||||
updateTool(b->tool());
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureWidget::loadDrawThickness()
|
||||
{
|
||||
if ((activeButtonToolType() == CaptureTool::TYPE_TEXT) ||
|
||||
(m_activeTool && m_activeTool->type() == CaptureTool::TYPE_TEXT)) {
|
||||
m_context.thickness = m_config.drawFontSize();
|
||||
} else {
|
||||
m_context.thickness = m_config.drawThickness();
|
||||
}
|
||||
emit m_sidePanel->thicknessChanged(m_context.thickness);
|
||||
}
|
||||
|
||||
void CaptureWidget::handleToolSignal(CaptureTool::Request r)
|
||||
{
|
||||
switch (r) {
|
||||
@@ -1137,16 +1128,52 @@ void CaptureWidget::handleToolSignal(CaptureTool::Request r)
|
||||
}
|
||||
break;
|
||||
case CaptureTool::REQ_INCREASE_TOOL_SIZE:
|
||||
updateThickness(m_context.thickness + 1);
|
||||
setToolSize(m_context.toolSize + 1);
|
||||
break;
|
||||
case CaptureTool::REQ_DECREASE_TOOL_SIZE:
|
||||
updateThickness(m_context.thickness - 1);
|
||||
setToolSize(m_context.toolSize - 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Was setDrawThickness
|
||||
* - Update config options
|
||||
* - Update tool object thickness
|
||||
*/
|
||||
void CaptureWidget::onToolSizeChanged(int t)
|
||||
{
|
||||
CaptureTool* tool = activeButtonTool();
|
||||
if (tool && tool->showMousePreview()) {
|
||||
setCursor(Qt::BlankCursor);
|
||||
}
|
||||
|
||||
// update tool size of object being drawn
|
||||
if (m_activeTool != nullptr) {
|
||||
updateTool(m_activeTool);
|
||||
}
|
||||
|
||||
// update tool size of selected object
|
||||
auto toolItem = activeToolObject();
|
||||
if (toolItem) {
|
||||
// Change thickness
|
||||
toolItem->onSizeChanged(t);
|
||||
if (!m_existingObjectIsChanged) {
|
||||
m_captureToolObjectsBackup = m_captureToolObjects;
|
||||
m_existingObjectIsChanged = true;
|
||||
}
|
||||
drawToolsData();
|
||||
updateTool(toolItem);
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureWidget::onToolSizeSettled(int size)
|
||||
{
|
||||
m_config.setToolSize(activeButtonToolType(), size);
|
||||
}
|
||||
|
||||
void CaptureWidget::setDrawColor(const QColor& c)
|
||||
{
|
||||
m_context.color = c;
|
||||
@@ -1228,30 +1255,6 @@ void CaptureWidget::removeToolObject(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureWidget::setDrawThickness(int t)
|
||||
{
|
||||
m_context.thickness = qBound(1, t, maxDrawThickness);
|
||||
// save draw thickness for text and other tool separately
|
||||
if (m_activeButton) {
|
||||
if (activeButtonToolType() == CaptureTool::TYPE_TEXT) {
|
||||
m_config.setDrawFontSize(m_context.thickness);
|
||||
} else {
|
||||
m_config.setDrawThickness(m_context.thickness);
|
||||
}
|
||||
}
|
||||
|
||||
auto toolItem = activeToolObject();
|
||||
if (toolItem) {
|
||||
// Change thickness
|
||||
toolItem->onThicknessChanged(t);
|
||||
drawToolsData();
|
||||
drawObjectSelection();
|
||||
updateTool(toolItem);
|
||||
} else {
|
||||
emit thicknessChanged(m_context.thickness);
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureWidget::initShortcuts()
|
||||
{
|
||||
new QShortcut(
|
||||
@@ -1309,11 +1312,11 @@ void CaptureWidget::initShortcuts()
|
||||
|
||||
void CaptureWidget::deleteCurrentTool()
|
||||
{
|
||||
int thickness_old = m_context.thickness;
|
||||
int oldToolSize = m_context.toolSize;
|
||||
m_panel->slotButtonDelete(true);
|
||||
drawObjectSelection();
|
||||
if (thickness_old != m_context.thickness) {
|
||||
emit thicknessChanged(m_context.thickness);
|
||||
if (oldToolSize != m_context.toolSize) {
|
||||
emit toolSizeChanged(m_context.toolSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1400,9 +1403,9 @@ void CaptureWidget::pushToolToStack()
|
||||
m_activeTool,
|
||||
&CaptureTool::onColorChanged);
|
||||
disconnect(this,
|
||||
&CaptureWidget::thicknessChanged,
|
||||
&CaptureWidget::toolSizeChanged,
|
||||
m_activeTool,
|
||||
&CaptureTool::onThicknessChanged);
|
||||
&CaptureTool::onSizeChanged);
|
||||
if (m_panel->toolWidget()) {
|
||||
disconnect(m_panel->toolWidget(), nullptr, m_activeTool, nullptr);
|
||||
}
|
||||
@@ -1447,9 +1450,9 @@ void CaptureWidget::drawObjectSelection()
|
||||
if (toolItem && !toolItem->editMode()) {
|
||||
QPainter painter(&m_context.screenshot);
|
||||
toolItem->drawObjectSelection(painter);
|
||||
if (m_context.thickness != toolItem->thickness()) {
|
||||
m_context.thickness =
|
||||
toolItem->thickness() <= 0 ? 0 : toolItem->thickness();
|
||||
// TODO move this elsewhere
|
||||
if (m_context.toolSize != toolItem->size()) {
|
||||
m_context.toolSize = toolItem->size();
|
||||
}
|
||||
if (activeToolObject() && m_activeButton) {
|
||||
uncheckActiveTool();
|
||||
|
||||
@@ -59,7 +59,7 @@ signals:
|
||||
void captureTaken(uint id, QPixmap p, QRect selection);
|
||||
void captureFailed(uint id);
|
||||
void colorChanged(const QColor& c);
|
||||
void thicknessChanged(int thickness);
|
||||
void toolSizeChanged(int size);
|
||||
|
||||
private slots:
|
||||
void undo();
|
||||
@@ -73,7 +73,8 @@ private slots:
|
||||
void setState(CaptureToolButton* b);
|
||||
void handleToolSignal(CaptureTool::Request r);
|
||||
void setDrawColor(const QColor& c);
|
||||
void setDrawThickness(int t);
|
||||
void onToolSizeChanged(int size);
|
||||
void onToolSizeSettled(int size);
|
||||
void updateActiveLayer(int layer);
|
||||
void selectAll();
|
||||
|
||||
@@ -94,7 +95,6 @@ protected:
|
||||
void changeEvent(QEvent* changeEvent) override;
|
||||
|
||||
private:
|
||||
void loadDrawThickness();
|
||||
void pushObjectsStateToUndoStack();
|
||||
void releaseActiveTool();
|
||||
void uncheckActiveTool();
|
||||
@@ -116,7 +116,7 @@ private:
|
||||
void pushToolToStack();
|
||||
void makeChild(QWidget* w);
|
||||
|
||||
void updateThickness(int thicknessOffset);
|
||||
void setToolSize(int size);
|
||||
|
||||
QRect extendedSelection() const;
|
||||
QRect extendedRect(const QRect& r) const;
|
||||
@@ -144,7 +144,7 @@ private:
|
||||
|
||||
// Outside selection opacity
|
||||
int m_opacity;
|
||||
int m_thicknessByKeyboard;
|
||||
int m_toolSizeByKeyboard;
|
||||
|
||||
// utility flags
|
||||
bool m_mouseIsClicked;
|
||||
|
||||
@@ -31,12 +31,12 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
|
||||
}
|
||||
|
||||
QFormLayout* colorForm = new QFormLayout();
|
||||
m_thicknessSlider = new QSlider(Qt::Horizontal);
|
||||
m_thicknessSlider->setRange(1, maxDrawThickness);
|
||||
m_thicknessSlider->setValue(m_thickness);
|
||||
m_toolSizeSlider = new QSlider(Qt::Horizontal);
|
||||
m_toolSizeSlider->setRange(1, maxToolSize);
|
||||
m_toolSizeSlider->setValue(m_toolSize);
|
||||
m_colorLabel = new QLabel();
|
||||
m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
colorForm->addRow(tr("Active thickness:"), m_thicknessSlider);
|
||||
colorForm->addRow(tr("Active tool size:"), m_toolSizeSlider);
|
||||
colorForm->addRow(tr("Active color:"), m_colorLabel);
|
||||
m_layout->addLayout(colorForm);
|
||||
|
||||
@@ -56,15 +56,15 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
|
||||
m_layout->addWidget(m_colorWheel);
|
||||
m_layout->addWidget(m_colorHex);
|
||||
|
||||
// thickness sigslots
|
||||
connect(m_thicknessSlider,
|
||||
// tool size sigslots
|
||||
connect(m_toolSizeSlider,
|
||||
&QSlider::sliderMoved,
|
||||
this,
|
||||
&SidePanelWidget::thicknessChanged);
|
||||
&SidePanelWidget::toolSizeChanged);
|
||||
connect(this,
|
||||
&SidePanelWidget::thicknessChanged,
|
||||
&SidePanelWidget::toolSizeChanged,
|
||||
this,
|
||||
&SidePanelWidget::updateThickness);
|
||||
&SidePanelWidget::onToolSizeChanged);
|
||||
// color hex editor sigslots
|
||||
connect(m_colorHex, &QLineEdit::editingFinished, this, [=]() {
|
||||
if (!QColor::isValidColor(m_colorHex->text())) {
|
||||
@@ -93,10 +93,10 @@ void SidePanelWidget::onColorChanged(const QColor& c)
|
||||
m_colorWheel->setColor(c);
|
||||
}
|
||||
|
||||
void SidePanelWidget::updateThickness(const int& t)
|
||||
void SidePanelWidget::onToolSizeChanged(const int& t)
|
||||
{
|
||||
m_thickness = qBound(0, t, maxDrawThickness);
|
||||
m_thicknessSlider->setValue(m_thickness);
|
||||
m_toolSize = qBound(0, t, maxToolSize);
|
||||
m_toolSizeSlider->setValue(m_toolSize);
|
||||
}
|
||||
|
||||
void SidePanelWidget::startColorGrab()
|
||||
|
||||
@@ -14,7 +14,7 @@ class ColorGrabWidget;
|
||||
class QColorPickingEventFilter;
|
||||
class QSlider;
|
||||
|
||||
constexpr int maxDrawThickness = 50;
|
||||
constexpr int maxToolSize = 50;
|
||||
|
||||
class SidePanelWidget : public QWidget
|
||||
{
|
||||
@@ -27,12 +27,12 @@ public:
|
||||
|
||||
signals:
|
||||
void colorChanged(const QColor& c);
|
||||
void thicknessChanged(int t);
|
||||
void toolSizeChanged(int t);
|
||||
void togglePanel();
|
||||
|
||||
public slots:
|
||||
void onToolSizeChanged(const int& t);
|
||||
void onColorChanged(const QColor& c);
|
||||
void updateThickness(const int& t);
|
||||
|
||||
private slots:
|
||||
void startColorGrab();
|
||||
@@ -56,6 +56,6 @@ private:
|
||||
QPixmap* m_pixmap;
|
||||
QColor m_color;
|
||||
QColor m_revertColor;
|
||||
QSlider* m_thicknessSlider;
|
||||
int m_thickness;
|
||||
QSlider* m_toolSizeSlider;
|
||||
int m_toolSize;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user