KDE Bug Tracking System
Home
Report New Wish or Bug
Query Existing Reports
First
Last
Prev
Next
No search results available
Search page
Bug
138429
:
cannot add text to picture after cancel
P
roduct
:
krita
Co
m
ponent
:
general
Status
:
RESOLVED
Resolution
:
FIXED
Target
:
---
Version
:
1.6.1
Pr
i
ority
:
NOR
Severity
:
normal
V
otes
:
0
Description
:
Opened:
2006-12-06 07:53
Last Changed:
2006-12-30 09:12:53
Version: 1.6.1 (using KDE KDE 3.5.5) Installed from: SuSE RPMs OS: Linux Steps to reproduce: 1. Open Krita 2. Open a jpeg image. 3. Choose the text tool from the tool bar. 4. Click on the image to add text. 5. Click cancel in the dialog to add text. 6. The text tool will no longer work. Expected behavior: The text tool should continue to work no matter how many times the dialog is canceled.
Comment
#1
Brice Hunt 2006-12-06 07:54:40
Clarification in item number 5 to reproduce the bug: Should read click the "Cancel" button in the new text dialog box.
Comment
#2
boud valdyas org 2006-12-06 08:21:44
Ah, bah. This must be related to my fixes for
http://bugs.kde.org/show_bug.cgi?id=136151
:-(.
Comment
#3
boud valdyas org 2006-12-06 08:22:25
Cyrille's fixes, actually. But I'll look at it.
Comment
#4
boud valdyas org 2006-12-30 09:11:26
SVN commit 617757 by rempt: BUG: 138429 Simple fix for this bug. Also: add keyboard handling to the move tool for pixel-precise layer moving M +72 -3 kis_tool_move.cc M +14 -1 kis_tool_move.h M +3 -2 kis_tool_text.cc --- branches/koffice/1.6/koffice/krita/plugins/tools/defaulttools/kis_tool_move.cc #617756:617757 @@ -39,10 +39,14 @@ KisToolMove::KisToolMove() : super(i18n("Move Tool")) + , m_subject( 0 ) + , m_keyEvent( 0 ) { setName("tool_move"); - m_subject = 0; + setCursor(KisCursor::moveCursor()); + m_repeatTimer = new QTimer(this); + connect( m_repeatTimer, SIGNAL( timeout() ), this, SLOT( slotMove() ) ); } KisToolMove::~KisToolMove() @@ -66,14 +70,13 @@ if (!img || !(dev = img->activeLayer())) return; - m_dragStart = pos; m_strategy.startDrag(pos); } } void KisToolMove::move(KisMoveEvent *e) { - if (m_subject) { + if (m_subject && e->state() == QMouseEvent::LeftButton) { QPoint pos = e->pos().floorQPoint(); if((e->state() & Qt::AltButton) || (e->state() & Qt::ControlButton)) { if(fabs(pos.x() - m_dragStart.x()) > fabs(pos.y() - m_dragStart.y())) @@ -110,3 +113,69 @@ } } + +void KisToolMove::keyPress( QKeyEvent *e ) +{ + m_keyEvent = e; + + if (m_subject) { + + KisImageSP img = m_subject->currentImg(); + KisLayerSP dev; + + if (!img || !(dev = img->activeLayer())) + return; + + m_dragStart = QPoint( 0, 0 ); + m_strategy.startDrag( m_dragStart ); + m_steps = 1; + m_repeatTimer->start(200); + + } +} + +void KisToolMove::keyRelease(QKeyEvent *) +{ + m_repeatTimer->stop(); + + if ( m_subject && m_keyEvent) { + + if ( m_keyEvent->key() == Qt::Key_Left ) { + m_strategy.endDrag(QPoint( -m_steps, 0 )); + } + else if ( m_keyEvent->key() == Qt::Key_Right ) { + m_strategy.endDrag(QPoint(m_steps, 0) ); + } + else if ( m_keyEvent->key() == Qt::Key_Up ) { + m_strategy.endDrag(QPoint(0, -m_steps) ); + } + else if ( m_keyEvent->key() == Qt::Key_Down ) { + m_strategy.endDrag(QPoint(0, m_steps) ); + } + } + m_steps = 0; + m_keyEvent = 0; + +} + +void KisToolMove::slotMove() +{ + if (m_subject && m_keyEvent) { + + if ( m_keyEvent->key() == Qt::Key_Left ) { + m_strategy.drag(QPoint(-m_steps, 0) ); + } + else if ( m_keyEvent->key() == Qt::Key_Right ) { + m_strategy.drag(QPoint(m_steps, 0) ); + } + else if ( m_keyEvent->key() == Qt::Key_Up ) { + m_strategy.drag(QPoint(0, -m_steps) ); + } + else if ( m_keyEvent->key() == Qt::Key_Down ) { + m_strategy.drag(QPoint(0, m_steps) ); + } + + ++m_steps; + } + +} --- branches/koffice/1.6/koffice/krita/plugins/tools/defaulttools/kis_tool_move.h #617756:617757 @@ -21,11 +21,14 @@ #ifndef KIS_TOOL_MOVE_H_ #define KIS_TOOL_MOVE_H_ +#include <qtimer.h> + #include "kis_strategy_move.h" #include "kis_tool_non_paint.h" #include "kis_tool_factory.h" -// XXX: Moving is not nearly smooth enough! +class QTimer; + class KisToolMove : public KisToolNonPaint { typedef KisToolNonPaint super; @@ -46,11 +49,21 @@ virtual void buttonPress(KisButtonPressEvent *e); virtual void move(KisMoveEvent *e); virtual void buttonRelease(KisButtonReleaseEvent *e); + virtual void keyPress(QKeyEvent *e); + virtual void keyRelease(QKeyEvent *e); +private slots: + + void slotMove(); + private: + KisCanvasSubject *m_subject; KisStrategyMove m_strategy; QPoint m_dragStart; + QTimer * m_repeatTimer; + QKeyEvent * m_keyEvent; + int m_steps; }; --- branches/koffice/1.6/koffice/krita/plugins/tools/defaulttools/kis_tool_text.cc #617756:617757 @@ -83,7 +83,6 @@ if (m_subject && e->button() == QMouseEvent::LeftButton) { if(!m_wasPressed) return; - m_windowIsBeingShown = true; m_wasPressed = false; KisImageSP img = m_subject->currentImg(); @@ -91,8 +90,10 @@ bool ok; QString text = KInputDialog::getText(i18n("Font Tool"), i18n("Enter text:"), QString::null, &ok); - if (!ok) + if (!ok) { + m_windowIsBeingShown = false; return; + } KisUndoAdapter *undoAdapter = img->undoAdapter(); if (undoAdapter) {
Comment
#5
boud valdyas org 2006-12-30 09:12:53
***
Bug 139013
has been marked as a duplicate of this bug. ***
P
latform
:
SuSE RPMs
O
S
:
Linux
K
eywords
:
People
Reporter
:
Brice Hunt
Assigned To
:
CC
:
jlermer gmx de
Related actions
View Bug Activity
Format For Printing
XML
Clone This Bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Attachments
Add an attachment
(proposed patch, testcase, etc.)
Depends on
:
B
locks
:
Show dependency tree
-
Show dependency graph
First
Last
Prev
Next
No search results available
Search page
Actions
Reports
Requests
Reports
Bugs reported today
Bugs reported in the last 3 days
Bug reports with patches
Weekly Bug statistics
The most hated bugs
The most severe bugs
The most frequently reported bugs
The most wanted features
Junior Jobs
Report ownership counts and charts
My Account
New Account
Log In