Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Krita
Commits
96b04eda
Commit
96b04eda
authored
May 01, 2019
by
Halla Rempt
Browse files
Warn the user when trying to add a shape to a clone layer
BUG:406730
parent
342b87f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
libs/ui/tool/kis_tool_polyline_base.cpp
View file @
96b04eda
...
...
@@ -31,6 +31,7 @@
#include
<KisViewManager.h>
#include
<kis_action.h>
#include
<kactioncollection.h>
#include
<kis_icon.h>
#include
"kis_action_registry.h"
...
...
@@ -78,10 +79,16 @@ bool KisToolPolylineBase::hasUserInteractionRunning() const
void
KisToolPolylineBase
::
beginPrimaryAction
(
KoPointerEvent
*
event
)
{
Q_UNUSED
(
event
);
if
((
m_type
==
PAINT
&&
(
!
nodeEditable
()
||
nodeP
aint
A
bility
()
==
UNPAINTABLE
))
||
NodePaintAbility
paintability
=
nodePaintAbility
();
if
((
m_type
==
PAINT
&&
(
!
nodeEditable
()
||
p
aint
a
bility
==
UNPAINTABLE
||
paintability
==
KisToolPaint
::
CLONE
))
||
(
m_type
==
SELECT
&&
!
selectionEditable
()))
{
if
(
paintability
==
KisToolPaint
::
CLONE
){
KisCanvas2
*
kiscanvas
=
static_cast
<
KisCanvas2
*>
(
canvas
());
QString
message
=
i18n
(
"This tool cannot paint on clone layers. Please select a paint or vector layer or mask."
);
kiscanvas
->
viewManager
()
->
showFloatingMessage
(
message
,
koIcon
(
"object-locked"
));
}
event
->
ignore
();
return
;
}
...
...
libs/ui/tool/kis_tool_rectangle_base.cpp
View file @
96b04eda
...
...
@@ -26,6 +26,8 @@
#include
<KoCanvasController.h>
#include
<KoViewConverter.h>
#include
"kis_canvas2.h"
#include
"KisViewManager.h"
#include
<kis_icon.h>
#include
"kis_rectangle_constraint_widget.h"
...
...
@@ -109,8 +111,14 @@ bool KisToolRectangleBase::listeningToModifiers()
void
KisToolRectangleBase
::
beginPrimaryAction
(
KoPointerEvent
*
event
)
{
if
((
m_type
==
PAINT
&&
(
!
nodeEditable
()
||
nodePaintAbility
()
==
UNPAINTABLE
))
||
(
m_type
==
SELECT
&&
!
selectionEditable
()))
{
NodePaintAbility
paintability
=
nodePaintAbility
();
if
((
m_type
==
PAINT
&&
(
!
nodeEditable
()
||
paintability
==
UNPAINTABLE
||
paintability
==
KisToolPaint
::
CLONE
))
||
(
m_type
==
SELECT
&&
!
selectionEditable
()))
{
if
(
paintability
==
KisToolPaint
::
CLONE
){
KisCanvas2
*
kiscanvas
=
static_cast
<
KisCanvas2
*>
(
canvas
());
QString
message
=
i18n
(
"This tool cannot paint on clone layers. Please select a paint or vector layer or mask."
);
kiscanvas
->
viewManager
()
->
showFloatingMessage
(
message
,
koIcon
(
"object-locked"
));
}
event
->
ignore
();
return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment