Commit 34f0c7f1 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Show the default tool warning for non-vector layers on clicking

Instead of when the default tool paints.

BUG:393859
(cherry picked from commit c8c845d1c5c5aa2085fd807fc631527e4d50f94d)
parent c09a4b2c
......@@ -698,15 +698,6 @@ void DefaultTool::updateCursor()
void DefaultTool::paint(QPainter &painter, const KoViewConverter &converter)
{
// this tool only works on a vector layer right now, so give a warning if another layer type is trying to use it
if (!isValidForCurrentLayer()) {
KisCanvas2 *kiscanvas = static_cast<KisCanvas2 *>(canvas());
kiscanvas->viewManager()->showFloatingMessage(
i18n("This tool only works on vector layers. You probably want the move tool."),
QIcon(), 2000, KisFloatingMessage::Medium, Qt::AlignCenter);
return;
}
KoSelection *selection = koSelection();
if (selection) {
SelectionDecorator decorator(canvas()->resourceManager());
......@@ -737,6 +728,15 @@ KoShapeManager *DefaultTool::shapeManager() const {
void DefaultTool::mousePressEvent(KoPointerEvent *event)
{
// this tool only works on a vector layer right now, so give a warning if another layer type is trying to use it
if (!isValidForCurrentLayer()) {
KisCanvas2 *kiscanvas = static_cast<KisCanvas2 *>(canvas());
kiscanvas->viewManager()->showFloatingMessage(
i18n("This tool only works on vector layers. You probably want the move tool."),
QIcon(), 2000, KisFloatingMessage::Medium, Qt::AlignCenter);
return;
}
KoInteractionTool::mousePressEvent(event);
updateCursor();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment