summaryrefslogtreecommitdiff
path: root/inputmethods/handwriting/qimpenwordpick.cpp
Side-by-side diff
Diffstat (limited to 'inputmethods/handwriting/qimpenwordpick.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpenwordpick.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/inputmethods/handwriting/qimpenwordpick.cpp b/inputmethods/handwriting/qimpenwordpick.cpp
index 8ee103d..39745c6 100644
--- a/inputmethods/handwriting/qimpenwordpick.cpp
+++ b/inputmethods/handwriting/qimpenwordpick.cpp
@@ -59,55 +59,55 @@ int QIMPenWordPick::onWord( QPoint p )
if ( x + w > width() )
break;
if ( p.x() > x-2 && p.x() < x + w + 2 )
return idx;
x += w + 5;
if ( !idx )
x += 3;
idx++;
}
return -1;
}
void QIMPenWordPick::paintEvent( QPaintEvent * )
{
QPainter p(this);
int x = 2;
int h = p.fontMetrics().ascent() + 1;
int idx = 0;
for ( QStringList::Iterator it = words.begin(); it != words.end(); ++it ) {
QString word = *it;
int w = p.fontMetrics().width( word );
if ( x + w > width() )
break;
if ( idx == clickWord ) {
p.fillRect( x, 0, w, height(), black );
p.setPen( white );
} else {
p.setPen( colorGroup().text() );
}
p.drawText( x, h, word );
x += w + 5;
if ( !idx )
x += 3;
idx++;
}
}
void QIMPenWordPick::mousePressEvent( QMouseEvent *e )
{
clickWord = onWord( e->pos() );
repaint();
}
void QIMPenWordPick::mouseReleaseEvent( QMouseEvent *e )
{
int wordIdx = onWord( e->pos() );
if ( wordIdx >= 0 && wordIdx == clickWord ) {
- //qDebug( "Clicked %s", words[wordIdx].latin1() );
+ //odebug << "Clicked " << words[wordIdx].latin1() << oendl;
emit wordClicked( words[wordIdx] );
}
clickWord = -1;
repaint();
}