author | hash <hash> | 2002-08-22 16:30:01 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-22 16:30:01 (UTC) |
commit | 4b0db964f77e4b3caa1f95ea753c89094b86e0d6 (patch) (unidiff) | |
tree | 1be74ef5d6bf3101815b5ecdafb21c0db470715e /inputmethods/multikey | |
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
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 19 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.h | 6 |
2 files changed, 13 insertions, 12 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) | |||
178 | pressed || keys->pressed(row, col) ? keycolor_pressed : keycolor); | 178 | pressed || keys->pressed(row, col) ? keycolor_pressed : keycolor); |
179 | 179 | ||
180 | QPixmap *pix = keys->pix(row,col); | 180 | QImage *pix = keys->pix(row,col); |
181 | 181 | ||
182 | ushort c = keys->uni(row, col); | 182 | ushort c = keys->uni(row, col); |
@@ -196,5 +196,5 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) | |||
196 | else | 196 | else |
197 | // center the image in the middle of the key | 197 | // center the image in the middle of the key |
198 | p.drawPixmap( x + (defaultKeyWidth * keyWidth - pix->width())/2, | 198 | p.drawImage( x + (defaultKeyWidth * keyWidth - pix->width())/2, |
199 | y + (keyHeight - pix->height())/2 + 1, | 199 | y + (keyHeight - pix->height())/2 + 1, |
200 | *pix ); | 200 | *pix ); |
@@ -220,5 +220,5 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) | |||
220 | for (int col = 0; col < keys->numKeys(row); col++) { | 220 | for (int col = 0; col < keys->numKeys(row); col++) { |
221 | 221 | ||
222 | QPixmap *pix = keys->pix(row, col); | 222 | QImage *pix = keys->pix(row, col); |
223 | int keyWidth = keys->width(row, col); | 223 | int keyWidth = keys->width(row, col); |
224 | 224 | ||
@@ -245,7 +245,8 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col) | |||
245 | else { | 245 | else { |
246 | // center the image in the middle of the key | 246 | // center the image in the middle of the key |
247 | p.drawPixmap( x + (keyWidthPix - pix->width())/2, | 247 | pix->setColor(1, textcolor.rgb()); |
248 | p.drawImage( x + (keyWidthPix - pix->width())/2, | ||
248 | y + (keyHeight - pix->height())/2 + 1, | 249 | y + (keyHeight - pix->height())/2 + 1, |
249 | QPixmap(*pix) ); | 250 | QImage(*pix) ); |
250 | } | 251 | } |
251 | 252 | ||
@@ -1045,5 +1046,5 @@ void Keys::setKeysFromFile(const char * filename) { | |||
1045 | QString comment; | 1046 | QString comment; |
1046 | char * xpm[256]; //couldnt be larger than that... could it? | 1047 | char * xpm[256]; //couldnt be larger than that... could it? |
1047 | QPixmap *xpm2pix = 0; | 1048 | QImage *xpm2pix = 0; |
1048 | 1049 | ||
1049 | buf = t.readLine(); | 1050 | buf = t.readLine(); |
@@ -1091,5 +1092,5 @@ void Keys::setKeysFromFile(const char * filename) { | |||
1091 | if (xpmLineCount) { | 1092 | if (xpmLineCount) { |
1092 | 1093 | ||
1093 | xpm2pix = new QPixmap((const char **)xpm); | 1094 | xpm2pix = new QImage((const char **)xpm); |
1094 | for (int i = 0; i < xpmLineCount; i++) | 1095 | for (int i = 0; i < xpmLineCount; i++) |
1095 | 1096 | ||
@@ -1160,5 +1161,5 @@ void Keys::setKeysFromFile(const char * filename) { | |||
1160 | // Keys::setKey {{{2 | 1161 | // Keys::setKey {{{2 |
1161 | void Keys::setKey(const int row, const int qcode, const ushort unicode, | 1162 | void Keys::setKey(const int row, const int qcode, const ushort unicode, |
1162 | const int width, QPixmap *pix) { | 1163 | const int width, QImage *pix) { |
1163 | 1164 | ||
1164 | Key * key; | 1165 | Key * key; |
@@ -1217,5 +1218,5 @@ int Keys::qcode(const int row, const int col) { | |||
1217 | } | 1218 | } |
1218 | 1219 | ||
1219 | QPixmap *Keys::pix(const int row, const int col) { | 1220 | QImage *Keys::pix(const int row, const int col) { |
1220 | 1221 | ||
1221 | return keys[row].at(col)->pix; | 1222 | return keys[row].at(col)->pix; |
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index b692975..1aa7a35 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h | |||
@@ -64,9 +64,9 @@ public: | |||
64 | ushort shift(const ushort); | 64 | ushort shift(const ushort); |
65 | ushort meta(const ushort); | 65 | ushort meta(const ushort); |
66 | QPixmap *pix(const int row, const int col); | 66 | QImage *pix(const int row, const int col); |
67 | int numKeys(const int row); | 67 | int numKeys(const int row); |
68 | void setKeysFromFile(const char *filename); | 68 | void setKeysFromFile(const char *filename); |
69 | void setKey(const int row, const int qcode, const ushort unicode, | 69 | void setKey(const int row, const int qcode, const ushort unicode, |
70 | const int width, QPixmap *pix); | 70 | const int width, QImage *pix); |
71 | void setPressed(const int row, const int col, const bool pressed); | 71 | void setPressed(const int row, const int col, const bool pressed); |
72 | QString lang; | 72 | QString lang; |
@@ -82,5 +82,5 @@ private: | |||
82 | // only needed for keys like ctrl that can have multiple keys pressed at once | 82 | // only needed for keys like ctrl that can have multiple keys pressed at once |
83 | bool *pressed; | 83 | bool *pressed; |
84 | QPixmap *pix; | 84 | QImage *pix; |
85 | }; | 85 | }; |
86 | 86 | ||