summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Unidiff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 619ae39..9181936 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -751,48 +751,59 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
751 } 751 }
752 752
753 // if it is a holiday then use the default holiday color 753 // if it is a holiday then use the default holiday color
754 if (!mHolidays[i].isNull()) { 754 if (!mHolidays[i].isNull()) {
755 if ( bDays.testBit(i) ) { 755 if ( bDays.testBit(i) ) {
756 p.setPen(Qt::green); 756 p.setPen(Qt::green);
757 } else { 757 } else {
758 if (actcol == mDefaultTextColor) { 758 if (actcol == mDefaultTextColor) {
759 p.setPen(KOPrefs::instance()->mHolidayColor); 759 p.setPen(KOPrefs::instance()->mHolidayColor);
760 } else { 760 } else {
761 p.setPen(mHolidayColorShaded); 761 p.setPen(mHolidayColorShaded);
762 } 762 }
763 } 763 }
764 } 764 }
765 765
766 // draw selected days with special color 766 // draw selected days with special color
767 // DO NOT specially highlight holidays in selection ! 767 // DO NOT specially highlight holidays in selection !
768 if (i >= mSelStartT && i <= mSelEndT) { 768 if (i >= mSelStartT && i <= mSelEndT) {
769 ;//p.setPen(mSelectedDaysColor); 769 ;//p.setPen(mSelectedDaysColor);
770 } 770 }
771 771
772 p.drawText(col*dwidth, row*dheight, dwidth, dheight, 772 p.drawText(col*dwidth, row*dheight, dwidth, dheight,
773 Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); 773 Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]);
774 774
775 // reset color to actual color 775 // reset color to actual color
776 if (!mHolidays[i].isNull()) { 776 if (!mHolidays[i].isNull()) {
777 p.setPen(actcol); 777 p.setPen(actcol);
778 } 778 }
779 // reset bold font to plain font 779 // reset bold font to plain font
780 if (events[i] > 0) { 780 if (events[i] > 0) {
781 QFont myFont = font(); 781 QFont myFont = font();
782 myFont.setBold(false); 782 myFont.setBold(false);
783 p.setFont(myFont); 783 p.setFont(myFont);
784 } 784 }
785 } 785 }
786 bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP); 786 bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
787} 787}
788 788
789// ---------------------------------------------------------------------------- 789// ----------------------------------------------------------------------------
790// R E SI Z E E V E N T H A N D L I N G 790// R E SI Z E E V E N T H A N D L I N G
791// ---------------------------------------------------------------------------- 791// ----------------------------------------------------------------------------
792 792
793void KODayMatrix::resizeEvent(QResizeEvent *) 793void KODayMatrix::resizeEvent(QResizeEvent *)
794{ 794{
795 QRect sz = frameRect(); 795 QRect sz = frameRect();
796 daysize.setHeight(sz.height()*7 / NUMDAYS); 796 daysize.setHeight(sz.height()*7 / NUMDAYS);
797 daysize.setWidth(sz.width() / 7); 797 daysize.setWidth(sz.width() / 7);
798} 798}
799
800QSize KODayMatrix::sizeHint() const
801{
802
803 QFontMetrics fm ( font() );
804 int wid = fm.width( "30") *7+7;
805 int hei = fm.height() * 6+4;
806 //qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei);
807 return QSize ( wid, hei );
808
809}