-rw-r--r-- | korganizer/kodaymatrix.cpp | 21 |
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 @@ -657,41 +657,41 @@ void KODayMatrix::dropEvent(QDropEvent *e) // ---------------------------------------------------------------------------- // P A I N T E V E N T H A N D L I N G // ---------------------------------------------------------------------------- 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()); int dheight = daysize.height(); int dwidth = daysize.width(); 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 ) mSelEndT = NUMDAYS-1; // draw selected days with highlighted background color if (mSelStart != NOSELECTION) { @@ -760,13 +760,14 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) if ( rowModulo ) { if ( row >= 6 - rowModulo ) addRow = row - 5 + rowModulo; } 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; addRow = 0; if ( rowModulo ) { if ( mSelEndT/7 >= 6 - rowModulo ) @@ -911,13 +912,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) if (events[i] > 0) { QFont myFont = font(); myFont.setBold(false); p.setFont(myFont); } } - int off = xyOff; + int off = 0;//xyOff; bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP); //qDebug("ffffffffff %d ", off); } // ---------------------------------------------------------------------------- // R E SI Z E E V E N T H A N D L I N G |