Commit a32f95f4 authored by Halla Rempt's avatar Halla Rempt
Browse files

BUG:353809 Fix typing in the artistic text tool

We have two text tools, and in 022f939c9d6c20f1717e1c81d10a5519f9de5f1d
only the multiline text tool was ported to the new shortcut override
system.

CCMAIL:faure@kde.org
parent a18b5e44
......@@ -62,6 +62,15 @@
const int BlinkInterval = 500;
static bool hit(const QKeySequence &input, KStandardShortcut::StandardShortcut shortcut)
{
foreach (const QKeySequence & ks, KStandardShortcut::shortcut(shortcut).toList()) {
if (input == ks)
return true;
}
return false;
}
ArtisticTextTool::ArtisticTextTool(KoCanvasBase *canvas)
: KoToolBase(canvas), m_selection(canvas, this), m_currentShape(0), m_hoverText(0), m_hoverPath(0), m_hoverHandle(false)
, m_textCursor( -1 ), m_showCursor( true ), m_currentStrategy(0)
......@@ -329,6 +338,15 @@ void ArtisticTextTool::mouseReleaseEvent( KoPointerEvent *event )
updateActions();
}
void ArtisticTextTool::shortcutOverrideEvent(QKeyEvent *event)
{
QKeySequence item(event->key() | ((Qt::ControlModifier | Qt::AltModifier) & event->modifiers()));
if (hit(item, KStandardShortcut::Begin) ||
hit(item, KStandardShortcut::End)) {
event->accept();
}
}
void ArtisticTextTool::mouseDoubleClickEvent(KoPointerEvent */*event*/)
{
if (m_hoverPath && m_currentShape) {
......
......@@ -50,6 +50,8 @@ public:
/// reimplemented
virtual void mouseReleaseEvent( KoPointerEvent *event );
/// reimplemented
virtual void shortcutOverrideEvent(QKeyEvent *event);
/// reimplemented
virtual void mouseDoubleClickEvent(KoPointerEvent *event);
/// reimplemented
virtual void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes);
......
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