summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Unidiff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (show 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)
660 660
661void KODayMatrix::paintEvent(QPaintEvent * pevent) 661void KODayMatrix::paintEvent(QPaintEvent * pevent)
662{ 662{
663 QRect sz = frameRect(); 663
664 if ( sz.width() <= 0 || sz.height() <= 0 ) 664 if ( width() <= 0 || height() <= 0 )
665 return; 665 return;
666 if ( mPendingUpdateBeforeRepaint ) { 666 if ( mPendingUpdateBeforeRepaint ) {
667 updateViewTimed(); 667 updateViewTimed();
668 mPendingUpdateBeforeRepaint = false; 668 mPendingUpdateBeforeRepaint = false;
669 } 669 }
670 if ( myPix.width() != sz.width() || myPix.height()!=sz.height() ) { 670 if ( myPix.width() != width() || myPix.height()!=height() ) {
671 myPix.resize(sz.size() ); 671 myPix.resize(size() );
672 } 672 }
673 QPainter p(&myPix); 673 QPainter p(&myPix);
674 p.setFont(font()); 674 p.setFont(font());
@@ -679,16 +679,16 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
679 int row,col; 679 int row,col;
680 int selw, selh; 680 int selw, selh;
681 int xyOff = frameWidth(); 681 int xyOff = frameWidth();
682 int colModulo = sz.width() % 7; 682 int colModulo = (width()-2) % 7;
683 int rowModulo = sz.height() % 6; 683 int rowModulo = (height()-2) % 6;
684 //qDebug("col %d row %d ",colModulo,rowModulo ); 684 //qDebug("col %d row %d ",colModulo,rowModulo );
685 685
686 bool isRTL = KOGlobals::self()->reverseLayout(); 686 bool isRTL = KOGlobals::self()->reverseLayout();
687 687
688 // draw background and topleft frame 688 // draw background and topleft frame
689 p.fillRect(pevent->rect(), mDefaultBackColor); 689 p.fillRect(0,0,width(),height(), mDefaultBackColor);
690 p.setPen(mDefaultTextColor); 690 p.setPen(mDefaultTextColor);
691 p.drawRect(0, 0, sz.width()+1, sz.height()+1); 691 p.drawRect(0, 0, width(), height());
692 int mSelStartT = mSelStart; 692 int mSelStartT = mSelStart;
693 int mSelEndT = mSelEnd; 693 int mSelEndT = mSelEnd;
694 if ( mSelEndT >= NUMDAYS ) 694 if ( mSelEndT >= NUMDAYS )
@@ -763,7 +763,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
763 } 763 }
764 if ( row == 0) 764 if ( row == 0)
765 addRow = 1; 765 addRow = 1;
766 p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo, 766 int drawWid = width()-(col*dwidth+1+addCol2)-1;
767 p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, drawWid,
767 dheight+1, selcol); 768 dheight+1, selcol);
768 // draw full block till last line 769 // draw full block till last line
769 selh = mSelEndT/7-row; 770 selh = mSelEndT/7-row;
@@ -914,7 +915,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
914 p.setFont(myFont); 915 p.setFont(myFont);
915 } 916 }
916 } 917 }
917 int off = xyOff; 918 int off = 0;//xyOff;
918 bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP); 919 bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP);
919 //qDebug("ffffffffff %d ", off); 920 //qDebug("ffffffffff %d ", off);
920} 921}