Version: 3.1.1 (using KDE 3.1.2) Installed from: SuSE Compiler: gcc version 3.3 20030226 (prerelease) (SuSE Linux) OS: Linux (i686) release 2.4.20-4GB-athlon In order to improve the readability of the monthly printout I think it would be great if the days of the previous and the next month would be grayed out / had a gray background. Thanks for this great program!
Subject: osnabrueck_branch: kdepim/korganizer CVS commit by kainhofe: When printing out the month view, use a gray background for the days of the previous/next months. Only the current month has a white background. CCMAIL: 71913-done@bugs.kde.org M +15 -0 calprintbase.cpp 1.14.2.1 --- kdepim/korganizer/calprintbase.cpp #1.14:1.14.2.1 @@ -634,4 +634,5 @@ void CalPrintBase::drawDayBox(QPainter & } + p.eraseRect( x, y, width, height ); p.drawRect( x, y, width, height ); // p.fillRect( x+1, y+1, width-2,height, QBrush(Dense7Pattern) ); @@ -777,4 +778,7 @@ void CalPrintBase::drawMonth(QPainter &p int xoffset = 0; QDate monthDate(QDate(qd.year(), qd.month(), 1)); + QDate monthFirst(monthDate); + QDate monthLast(monthDate.addMonths(1).addDays(-1)); + int weekdayCol = weekdayColumn( monthDate.dayOfWeek() ); @@ -803,8 +807,19 @@ void CalPrintBase::drawMonth(QPainter &p int cellWidth = (width-xoffset) / 7; + QColor back = p.backgroundColor(); + bool darkbg = false; for (int row = 0; row < rows; row++) { for (int col = 0; col < 7; col++) { + // show days from previous/next month with a grayed background + if ( (monthDate < monthFirst) || (monthDate > monthLast) ) { + p.setBackgroundColor( back.dark( 120 ) ); + darkbg = true; + } drawDayBox(p, monthDate, x+xoffset+col*cellWidth, y+yoffset+row*cellHeight, cellWidth, cellHeight); + if ( darkbg ) { + p.setBackgroundColor( back ); + darkbg = false; + } monthDate = monthDate.addDays(1); }