author | zautrix <zautrix> | 2005-03-08 09:24:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-08 09:24:53 (UTC) |
commit | 91e7aeec0b15d28eb263c0699fdce4a00a3669c6 (patch) (unidiff) | |
tree | 10bf2d72c94ab030c7a08b22d0880997c99dcfff /korganizer | |
parent | a50b432c475d2a0b97b3f8707666f7d2990cd8db (diff) | |
download | kdepimpi-91e7aeec0b15d28eb263c0699fdce4a00a3669c6.zip kdepimpi-91e7aeec0b15d28eb263c0699fdce4a00a3669c6.tar.gz kdepimpi-91e7aeec0b15d28eb263c0699fdce4a00a3669c6.tar.bz2 |
todo printing fixes
-rw-r--r-- | korganizer/calprintbase.cpp | 26 | ||||
-rw-r--r-- | korganizer/calprinter.cpp | 2 |
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 | |||
@@ -918,4 +918,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
918 | int left = possummary+(level*10); | 918 | int left = possummary+(level*10); |
919 | rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); | 919 | rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); |
920 | //qDebug("bottom1 %d ", rect.bottom() ); | ||
920 | if ( !item->description().isEmpty() && desc ) { | 921 | if ( !item->description().isEmpty() && desc ) { |
921 | outStr = item->description(); | 922 | outStr = item->description(); |
@@ -923,4 +924,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
923 | WordBreak, outStr ); | 924 | WordBreak, outStr ); |
924 | } | 925 | } |
926 | //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight ); | ||
925 | // if too big make new page | 927 | // if too big make new page |
926 | if ( rect.bottom() > y+height) { | 928 | if ( rect.bottom() > y+height) { |
@@ -965,8 +967,13 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
965 | // cross out the rectangle for completed items | 967 | // cross out the rectangle for completed items |
966 | if ( item->isCompleted() ) { | 968 | if ( item->isCompleted() ) { |
967 | p.drawLine( rect.topLeft(), rect.bottomRight() ); | 969 | p.drawLine( rect.topLeft(), rect.bottomRight() ); |
968 | p.drawLine( rect.topRight(), rect.bottomLeft() ); | 970 | p.drawLine( rect.topRight(), rect.bottomLeft() ); |
971 | } else if (item->cancelled() ) { | ||
972 | QPen pen = p.pen(); | ||
973 | p.setPen ( QPen ( black, 2) ); | ||
974 | p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); | ||
975 | p.setPen( pen ); | ||
969 | } | 976 | } |
970 | } | 977 | } |
971 | startpt.mRect = rect; //save for later | 978 | startpt.mRect = rect; //save for later |
972 | 979 | ||
@@ -987,7 +994,8 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
987 | 994 | ||
988 | // if completed, use strike out font | 995 | // if completed, use strike out font |
989 | QFont ft=p.font(); | 996 | // LR does not work - font is underlined, not striked out |
990 | ft.setStrikeOut( item->isCompleted() ); | 997 | //QFont ft=p.font(); |
991 | p.setFont( ft ); | 998 | //ft.setStrikeOut( item->isCompleted() ); |
999 | //p.setFont( ft ); | ||
992 | // summary | 1000 | // summary |
993 | outStr=item->summary(); | 1001 | outStr=item->summary(); |
@@ -995,5 +1003,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
995 | outStr += " ("+item->location()+")"; | 1003 | outStr += " ("+item->location()+")"; |
996 | if ( item->hasDueDate() && posDueDt>=0 ) { | 1004 | if ( item->hasDueDate() && posDueDt>=0 ) { |
997 | outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]"; | 1005 | outStr += " [" +item->dtDueStr(true)+"]"; |
998 | } | 1006 | } |
999 | rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), | 1007 | rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), |
@@ -1001,6 +1009,6 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
1001 | QRect newrect; | 1009 | QRect newrect; |
1002 | p.drawText( rect, WordBreak, outStr, -1, &newrect ); | 1010 | p.drawText( rect, WordBreak, outStr, -1, &newrect ); |
1003 | ft.setStrikeOut(false); | 1011 | //ft.setStrikeOut(false); |
1004 | p.setFont(ft); | 1012 | // p.setFont(ft); |
1005 | 1013 | ||
1006 | // due | 1014 | // due |
diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp index 6b5b0fe..0cdf28e 100644 --- a/korganizer/calprinter.cpp +++ b/korganizer/calprinter.cpp | |||
@@ -132,5 +132,5 @@ void CalPrinter::preview( PrintType type, const QDate &fd, const QDate &td ) | |||
132 | void CalPrinter::print( PrintType type, const QDate &fd, const QDate &td ) | 132 | void CalPrinter::print( PrintType type, const QDate &fd, const QDate &td ) |
133 | { | 133 | { |
134 | mPrintDialog->resize( 640, 380 ); | 134 | mPrintDialog->resize( 640, 440 ); |
135 | mPrintDialog->setPreview( false ); | 135 | mPrintDialog->setPreview( false ); |
136 | mPrintDialog->setPrintType( int( type ) ); | 136 | mPrintDialog->setPrintType( int( type ) ); |