summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/function_keyboard.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/function_keyboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp
index fa11701..3da8d61 100644
--- a/noncore/apps/opie-console/function_keyboard.cpp
+++ b/noncore/apps/opie-console/function_keyboard.cpp
@@ -91,25 +91,25 @@ void FunctionKeyboard::paintEvent(QPaintEvent *e) {
QString handle = "r" + QString::number(r) + "c" + QString::number(c);
if (keys.contains(handle)) {
if (keys[handle].pixFile.isEmpty())
p.drawText( c * keyWidth + 1, r * keyHeight + 1,
keyWidth, keyHeight,
Qt::AlignHCenter | Qt::AlignVCenter,
keys[handle].label
);
else {
- ushort centerX = c *keyWidth + (keyWidth - keys[handle].pix->width()) / 2;
+ ushort centerX = (ushort)(c *keyWidth) + (ushort)(keyWidth - keys[handle].pix->width()) / 2;
ushort centerY = r * keyHeight + (keyHeight - keys[handle].pix->height()) / 2;
p.drawPixmap(centerX, centerY, *keys[handle].pix);
}
}
}
}
}
void FunctionKeyboard::paintKey(uint row, uint col) {
QPainter p(this);
@@ -118,25 +118,25 @@ void FunctionKeyboard::paintKey(uint row, uint col) {
(pressedRow != -1 && pressedCol != -1 ) ? QColor(97,119,155) : QColor(255,255,255));
QString handle ("r" + QString::number(row) + "c" + QString::number(col));
if (keys[handle].pixFile.isEmpty())
p.drawText(
col * keyWidth + 1, row * keyHeight + 1,
keyWidth, keyHeight,
Qt::AlignHCenter | Qt::AlignVCenter,
keys[handle].label
);
else {
- ushort centerX = col *keyWidth + (keyWidth - keys[handle].pix->width()) / 2;
+ ushort centerX = (ushort)(col *keyWidth) + (ushort)(keyWidth - keys[handle].pix->width()) / 2;
ushort centerY = row * keyHeight + (keyHeight - keys[handle].pix->height()) / 2;
p.drawPixmap(centerX, centerY, *keys[handle].pix);
}
if (col == numCols - 1) {
// sometimes it doesnt draw the last line
p.drawLine((col+1) * keyWidth -1, row * keyHeight,
(col+1) * keyWidth -1, (row + 1) * keyHeight
);
}