author | hash <hash> | 2002-08-22 16:30:01 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-22 16:30:01 (UTC) |
commit | 4b0db964f77e4b3caa1f95ea753c89094b86e0d6 (patch) (side-by-side diff) | |
tree | 1be74ef5d6bf3101815b5ecdafb21c0db470715e /inputmethods/multikey/keyboard.cpp | |
parent | 8503abdc93f6f3ce93cee0f1176faa919dbd04f5 (diff) | |
download | opie-4b0db964f77e4b3caa1f95ea753c89094b86e0d6.zip opie-4b0db964f77e4b3caa1f95ea753c89094b86e0d6.tar.gz opie-4b0db964f77e4b3caa1f95ea753c89094b86e0d6.tar.bz2 |
xpm images now are the same color as the text
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 @@ -178,5 +178,5 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) 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); @@ -196,5 +196,5 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) 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 ); @@ -220,5 +220,5 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) 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); @@ -245,7 +245,8 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) 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) ); } @@ -1045,5 +1046,5 @@ void Keys::setKeysFromFile(const char * filename) { QString comment; char * xpm[256]; //couldnt be larger than that... could it? - QPixmap *xpm2pix = 0; + QImage *xpm2pix = 0; buf = t.readLine(); @@ -1091,5 +1092,5 @@ void Keys::setKeysFromFile(const char * filename) { if (xpmLineCount) { - xpm2pix = new QPixmap((const char **)xpm); + xpm2pix = new QImage((const char **)xpm); for (int i = 0; i < xpmLineCount; i++) @@ -1160,5 +1161,5 @@ 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; @@ -1217,5 +1218,5 @@ int Keys::qcode(const int row, const int col) { } -QPixmap *Keys::pix(const int row, const int col) { +QImage *Keys::pix(const int row, const int col) { return keys[row].at(col)->pix; |