summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calprintbase.cpp26
-rw-r--r--korganizer/calprinter.cpp2
2 files changed, 18 insertions, 10 deletions
diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp
index 6bb407d..f66fddc 100644
--- a/korganizer/calprintbase.cpp
+++ b/korganizer/calprintbase.cpp
@@ -914,17 +914,19 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
outStr += " ("+item->location()+")";
if ( item->hasDueDate() && posDueDt>=0 ) {
outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]";
}
int left = possummary+(level*10);
rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr);
+ //qDebug("bottom1 %d ", rect.bottom() );
if ( !item->description().isEmpty() && desc ) {
outStr = item->description();
rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1,
WordBreak, outStr );
}
+ //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight );
// if too big make new page
if ( rect.bottom() > y+height) {
// first draw the connection lines from parent todos:
if (level > 0 && connectSubTodos) {
TodoParentStart *rct;
for ( rct = startPoints.first(); rct; rct = startPoints.next() ) {
@@ -961,16 +963,21 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
rect.setHeight(19);
if ( priority > 0 && pospriority>=0 ) {
p.drawText(rect, AlignCenter, outStr);
p.drawRect(rect);
// cross out the rectangle for completed items
if ( item->isCompleted() ) {
- p.drawLine( rect.topLeft(), rect.bottomRight() );
- p.drawLine( rect.topRight(), rect.bottomLeft() );
+ p.drawLine( rect.topLeft(), rect.bottomRight() );
+ p.drawLine( rect.topRight(), rect.bottomLeft() );
+ } else if (item->cancelled() ) {
+ QPen pen = p.pen();
+ p.setPen ( QPen ( black, 2) );
+ p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 );
+ p.setPen( pen );
}
- }
+ }
startpt.mRect = rect; //save for later
// Connect the dots
if (level > 0 && connectSubTodos) {
int bottom;
int center( r->mRect.left() + (r->mRect.width()/2)+1 );
@@ -983,28 +990,29 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
p.moveTo(center, bottom);
p.lineTo(center, to);
p.lineTo(endx, to);
}
// if completed, use strike out font
- QFont ft=p.font();
- ft.setStrikeOut( item->isCompleted() );
- p.setFont( ft );
+ // LR does not work - font is underlined, not striked out
+ //QFont ft=p.font();
+ //ft.setStrikeOut( item->isCompleted() );
+ //p.setFont( ft );
// summary
outStr=item->summary();
if ( ! item->location().isEmpty() )
outStr += " ("+item->location()+")";
if ( item->hasDueDate() && posDueDt>=0 ) {
- outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]";
+ outStr += " [" +item->dtDueStr(true)+"]";
}
rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)),
-1, WordBreak, outStr);
QRect newrect;
p.drawText( rect, WordBreak, outStr, -1, &newrect );
- ft.setStrikeOut(false);
- p.setFont(ft);
+ //ft.setStrikeOut(false);
+ // p.setFont(ft);
// due
// if ( item->hasDueDate() && posDueDt>=0 ) {
// outStr = local->formatDate(item->dtDue().date(),true);
// rect = p.boundingRect(posdue, y, x+width, -1, AlignTop|AlignLeft, outStr);
// p.drawText(rect, AlignTop|AlignLeft, outStr);
diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp
index 6b5b0fe..0cdf28e 100644
--- a/korganizer/calprinter.cpp
+++ b/korganizer/calprinter.cpp
@@ -128,13 +128,13 @@ void CalPrinter::preview( PrintType type, const QDate &fd, const QDate &td )
doPrint( mPrintDialog->selectedPlugin(), true );
}
}
void CalPrinter::print( PrintType type, const QDate &fd, const QDate &td )
{
- mPrintDialog->resize( 640, 380 );
+ mPrintDialog->resize( 640, 440 );
mPrintDialog->setPreview( false );
mPrintDialog->setPrintType( int( type ) );
setDateRange( fd, td );
if ( mPrintDialog->exec() == QDialog::Accepted ) {
doPrint( mPrintDialog->selectedPlugin(), false );