summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
authorzautrix <zautrix>2005-03-22 16:21:03 (UTC)
committer zautrix <zautrix>2005-03-22 16:21:03 (UTC)
commitab8db23d665b276caa28471bb4db37e6b0de44ef (patch) (side-by-side diff)
tree4697da2d9426f155237614368f993328560d0b21 /korganizer/kodaymatrix.cpp
parentf36f0308a955f869f18c88ab359f9d605e838f1c (diff)
downloadkdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.zip
kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.tar.gz
kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.tar.bz2
fix
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 366e8b8..59618bf 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -660,15 +660,15 @@ void KODayMatrix::dropEvent(QDropEvent *e)
void KODayMatrix::paintEvent(QPaintEvent * pevent)
{
- QRect sz = frameRect();
- if ( sz.width() <= 0 || sz.height() <= 0 )
+
+ if ( width() <= 0 || height() <= 0 )
return;
if ( mPendingUpdateBeforeRepaint ) {
updateViewTimed();
mPendingUpdateBeforeRepaint = false;
}
- if ( myPix.width() != sz.width() || myPix.height()!=sz.height() ) {
- myPix.resize(sz.size() );
+ if ( myPix.width() != width() || myPix.height()!=height() ) {
+ myPix.resize(size() );
}
QPainter p(&myPix);
p.setFont(font());
@@ -679,16 +679,16 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
int row,col;
int selw, selh;
int xyOff = frameWidth();
- int colModulo = sz.width() % 7;
- int rowModulo = sz.height() % 6;
+ int colModulo = (width()-2) % 7;
+ int rowModulo = (height()-2) % 6;
//qDebug("col %d row %d ",colModulo,rowModulo );
bool isRTL = KOGlobals::self()->reverseLayout();
// draw background and topleft frame
- p.fillRect(pevent->rect(), mDefaultBackColor);
+ p.fillRect(0,0,width(),height(), mDefaultBackColor);
p.setPen(mDefaultTextColor);
- p.drawRect(0, 0, sz.width()+1, sz.height()+1);
+ p.drawRect(0, 0, width(), height());
int mSelStartT = mSelStart;
int mSelEndT = mSelEnd;
if ( mSelEndT >= NUMDAYS )
@@ -763,7 +763,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
}
if ( row == 0)
addRow = 1;
- p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo,
+ int drawWid = width()-(col*dwidth+1+addCol2)-1;
+ p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, drawWid,
dheight+1, selcol);
// draw full block till last line
selh = mSelEndT/7-row;
@@ -914,7 +915,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
p.setFont(myFont);
}
}
- int off = xyOff;
+ int off = 0;//xyOff;
bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP);
//qDebug("ffffffffff %d ", off);
}