author | hash <hash> | 2002-08-22 08:09:57 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-22 08:09:57 (UTC) |
commit | 2ff3290b552c575ff7222df29235651968f484aa (patch) (side-by-side diff) | |
tree | 15819ac788483336b90ececf5f5f635081c98c97 /inputmethods/multikey | |
parent | 8eee5a5dc6a43ed3cdd77095c3a91128fe76589e (diff) | |
download | opie-2ff3290b552c575ff7222df29235651968f484aa.zip opie-2ff3290b552c575ff7222df29235651968f484aa.tar.gz opie-2ff3290b552c575ff7222df29235651968f484aa.tar.bz2 |
coloring problem
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 89937cf..e3d3928 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp @@ -210,73 +210,75 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) p.fillRect(0, 0, width(), height(), keycolor); for (row = 1; row <= 5; row++) { int x = 0; int y = (row - 1) * keyHeight + (usePicks ? picks->height() : 0); p.setPen(keycolor_lines); p.drawLine(x, y, x + width(), y); for (int col = 0; col < keys->numKeys(row); col++) { QPixmap *pix = keys->pix(row, col); int keyWidth = keys->width(row, col); int keyWidthPix = defaultKeyWidth * keyWidth; if (keys->pressed(row, col)) p.fillRect(x+1, y+1, keyWidthPix - 1, keyHeight - 1, keycolor_pressed); ushort c = keys->uni(row, col); + p.setPen(textcolor); if (!pix) { if ((shift || lock) && keys->shift(c)) c = keys->shift(c); else if (meta && keys->meta(c)) c = keys->meta(c); p.drawText(x, y, - defaultKeyWidth * keyWidth + 3, keyHeight, + keyWidthPix + 3, keyHeight, AlignCenter, (QChar)c); } else { // center the image in the middle of the key p.drawPixmap( x + (keyWidthPix - pix->width())/2, y + (keyHeight - pix->height())/2 + 1, QPixmap(*pix) ); } p.setPen(keycolor_lines); p.drawLine(x, y, x, y + keyHeight); x += keyWidthPix; } } + p.setPen(keycolor_lines); p.drawLine(0, height() - 1, width(), height() - 1); p.drawLine(width() - 1, 0, width() - 1, height()); } } /* Keyboard::mousePressEvent {{{1 */ void Keyboard::mousePressEvent(QMouseEvent *e) { int row = (e->y() - (usePicks ? picks->height() : 0)) / keyHeight + 1; if (row > 5) row = 5; // figure out the column int col = 0; for (int w = 0; e->x() >= w; col++) if (col < keys->numKeys(row)) // it segfaults if it trys to read past numKeys w += keys->width(row,col) * defaultKeyWidth; else break; if (col <= 0) return; col --; // rewind one... |