summaryrefslogtreecommitdiff
authorhash <hash>2002-08-27 07:41:59 (UTC)
committer hash <hash>2002-08-27 07:41:59 (UTC)
commit8760fbdfefe1b6c60400cdeee45a6ba892d40751 (patch) (side-by-side diff)
tree50e8ad9d74c0332c5826a429abdeceb3142283b5
parent2bd07423a53f1b564b898dc9cf4dfbd6f1e337da (diff)
downloadopie-8760fbdfefe1b6c60400cdeee45a6ba892d40751.zip
opie-8760fbdfefe1b6c60400cdeee45a6ba892d40751.tar.gz
opie-8760fbdfefe1b6c60400cdeee45a6ba892d40751.tar.bz2
pixmaps centered better
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index c3ee8f3..92ea896 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -185,25 +185,25 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col)
if (shift || lock)
c = keys->shift(c);
if (meta) {
c = keys->meta(c);
}
p.drawText(x, y,
defaultKeyWidth * keyWidth + 3, keyHeight,
AlignCenter, (QChar)c);
}
else
// center the image in the middle of the key
- p.drawImage( x + (defaultKeyWidth * keyWidth - pix->width())/2,
+ p.drawImage( x + (defaultKeyWidth * keyWidth - pix->width())/2 + 1,
y + (keyHeight - pix->height())/2 + 1,
*pix );
// this fixes the problem that the very right end of the board's vertical line
// gets painted over, because it's one pixel shorter than all other keys
p.setPen(keycolor_lines);
p.drawLine(width() - 1, 0, width() - 1, height());
} else {
p.fillRect(0, 0, width(), height(), keycolor);
@@ -235,25 +235,25 @@ void Keyboard::drawKeyboard(QPainter &p, int row, int col)
if ((shift || lock) && keys->shift(c))
c = keys->shift(c);
else if (meta && keys->meta(c))
c = keys->meta(c);
p.drawText(x, y,
keyWidthPix + 3, keyHeight,
AlignCenter, (QChar)c);
}
else {
// center the image in the middle of the key
pix->setColor(1, textcolor.rgb());
- p.drawImage( x + (keyWidthPix - pix->width())/2,
+ p.drawImage( x + (keyWidthPix - pix->width())/2 + 1,
y + (keyHeight - pix->height())/2 + 1,
QImage(*pix) );
}
p.setPen(keycolor_lines);
p.drawLine(x, y, x, y + keyHeight);
x += keyWidthPix;
}
}