From 91e7aeec0b15d28eb263c0699fdce4a00a3669c6 Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 08 Mar 2005 09:24:53 +0000 Subject: todo printing fixes --- (limited to 'korganizer/calprintbase.cpp') diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp index 6bb407d..f66fddc 100644 --- a/korganizer/calprintbase.cpp +++ b/korganizer/calprintbase.cpp @@ -917,11 +917,13 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & } 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: @@ -964,10 +966,15 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & 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 @@ -986,22 +993,23 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & } // 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 ) { -- cgit v0.9.0.2