Diffstat (limited to 'inputmethods/multikey/keyboard.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index e3d3928..3f6f73b 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp @@ -176,9 +176,9 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) p.fillRect(x + 1, y + 1, keyWidth * defaultKeyWidth - 1, keyHeight - 1, pressed || keys->pressed(row, col) ? keycolor_pressed : keycolor); - QPixmap *pix = keys->pix(row,col); + QImage *pix = keys->pix(row,col); ushort c = keys->uni(row, col); p.setPen(textcolor); @@ -194,9 +194,9 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) AlignCenter, (QChar)c); } else // center the image in the middle of the key - p.drawPixmap( x + (defaultKeyWidth * keyWidth - pix->width())/2, + p.drawImage( x + (defaultKeyWidth * keyWidth - pix->width())/2, y + (keyHeight - pix->height())/2 + 1, *pix ); // this fixes the problem that the very right end of the board's vertical line @@ -218,9 +218,9 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) p.drawLine(x, y, x + width(), y); for (int col = 0; col < keys->numKeys(row); col++) { - QPixmap *pix = keys->pix(row, col); + QImage *pix = keys->pix(row, col); int keyWidth = keys->width(row, col); int keyWidthPix = defaultKeyWidth * keyWidth; @@ -243,11 +243,12 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) AlignCenter, (QChar)c); } else { // center the image in the middle of the key - p.drawPixmap( x + (keyWidthPix - pix->width())/2, + pix->setColor(1, textcolor.rgb()); + p.drawImage( x + (keyWidthPix - pix->width())/2, y + (keyHeight - pix->height())/2 + 1, - QPixmap(*pix) ); + QImage(*pix) ); } p.setPen(keycolor_lines); p.drawLine(x, y, x, y + keyHeight); @@ -1043,9 +1044,9 @@ void Keys::setKeysFromFile(const char * filename) { int width; QString buf; QString comment; char * xpm[256]; //couldnt be larger than that... could it? - QPixmap *xpm2pix = 0; + QImage *xpm2pix = 0; buf = t.readLine(); while (buf) { @@ -1089,9 +1090,9 @@ void Keys::setKeysFromFile(const char * filename) { buf = t.readLine(); } if (xpmLineCount) { - xpm2pix = new QPixmap((const char **)xpm); + xpm2pix = new QImage((const char **)xpm); for (int i = 0; i < xpmLineCount; i++) delete [] (xpm[i]); @@ -1158,9 +1159,9 @@ void Keys::setKeysFromFile(const char * filename) { } // Keys::setKey {{{2 void Keys::setKey(const int row, const int qcode, const ushort unicode, - const int width, QPixmap *pix) { + const int width, QImage *pix) { Key * key; key = new Key; key->qcode = qcode; @@ -1215,9 +1216,9 @@ int Keys::qcode(const int row, const int col) { return keys[row].at(col)->qcode; } -QPixmap *Keys::pix(const int row, const int col) { +QImage *Keys::pix(const int row, const int col) { return keys[row].at(col)->pix; } |