-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 | |||
@@ -659,17 +659,17 @@ void KODayMatrix::dropEvent(QDropEvent *e) | |||
659 | // ---------------------------------------------------------------------------- | 659 | // ---------------------------------------------------------------------------- |
660 | 660 | ||
661 | void KODayMatrix::paintEvent(QPaintEvent * pevent) | 661 | void 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()); |
675 | 675 | ||
@@ -678,18 +678,18 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
678 | int dwidth = daysize.width(); | 678 | int dwidth = daysize.width(); |
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 ) |
695 | mSelEndT = NUMDAYS-1; | 695 | mSelEndT = NUMDAYS-1; |
@@ -762,9 +762,10 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
762 | addRow = row - 5 + rowModulo; | 762 | addRow = row - 5 + rowModulo; |
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; |
770 | addRow = 0; | 771 | addRow = 0; |
@@ -913,9 +914,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
913 | myFont.setBold(false); | 914 | myFont.setBold(false); |
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 | } |
921 | 922 | ||