summaryrefslogtreecommitdiff
path: root/inputmethods
Side-by-side diff
Diffstat (limited to 'inputmethods') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp19
-rw-r--r--inputmethods/multikey/keyboard.h6
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)
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;
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:
ushort shift(const ushort);
ushort meta(const ushort);
- QPixmap *pix(const int row, const int col);
+ QImage *pix(const int row, const int col);
int numKeys(const int row);
void setKeysFromFile(const char *filename);
void setKey(const int row, const int qcode, const ushort unicode,
- const int width, QPixmap *pix);
+ const int width, QImage *pix);
void setPressed(const int row, const int col, const bool pressed);
QString lang;
@@ -82,5 +82,5 @@ private:
// only needed for keys like ctrl that can have multiple keys pressed at once
bool *pressed;
- QPixmap *pix;
+ QImage *pix;
};