summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweek.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp
index ddd41af..e30c776 100644
--- a/core/pim/datebook/datebookweek.cpp
+++ b/core/pim/datebook/datebookweek.cpp
@@ -192,5 +192,10 @@ void DateBookWeekView::positionItem( DateBookWeekItem *i )
192 y += db_round30min( ev.start().minute() ); 192 y += db_round30min( ev.start().minute() );
193 int y2 = ev.end().hour() * 2;
194 y2 += db_round30min( ev.end().minute() );
193 if ( y > 47 ) 195 if ( y > 47 )
194 y = 47; 196 y = 47;
197 if ( y2 > 48 )
198 y2 = 48;
195 y = y * rowHeight / 2; 199 y = y * rowHeight / 2;
200 y2 = y2 * rowHeight / 2;
196 201
@@ -198,10 +203,8 @@ void DateBookWeekView::positionItem( DateBookWeekItem *i )
198 if ( ev.event().type() == Event::AllDay ) { 203 if ( ev.event().type() == Event::AllDay ) {
199 h = 48; 204 h = 48 * rowHeight / 2;
200 y = 0; 205 y = 0;
201 } else { 206 } else {
202 h = ( ev.end().hour() - ev.start().hour() ) * 2; 207 h=y2-y;
203 h += db_round30min( ev.end().minute() - ev.start().minute() );
204 if ( h < 1 ) h = 1; 208 if ( h < 1 ) h = 1;
205 } 209 }
206 h = h * rowHeight / 2;
207 210
@@ -470,19 +473,11 @@ void DateBookWeek::generateNormalTooltext( QString& str,
470 str += "<b>" + QObject::tr("Start") + "</b>: "; 473 str += "<b>" + QObject::tr("Start") + "</b>: ";
471 474 str += TimeString::timeString( ev.event().start().time(), ampm, FALSE );
472 if ( ev.startDate() != ev.date() ) { 475 if( ev.startDate()!=ev.endDate() ) {
473 // multi-day event. Show start date 476 str += " <i>" + TimeString::longDateString( ev.startDate() )+"</i>";
474 str += TimeString::longDateString( ev.startDate() );
475 } else {
476 // Show start time.
477 str += TimeString::timeString(ev.start(), ampm, FALSE );
478 } 477 }
479 478 str += "<br>";
480 479 str += "<b>" + QObject::tr("End") + "</b>: ";
481 str += "<br><b>" + QObject::tr("End") + "</b>: "; 480 str += TimeString::timeString( ev.event().end().time(), ampm, FALSE );
482 if ( ev.endDate() != ev.date() ) { 481 if( ev.startDate()!=ev.endDate() ) {
483 // multi-day event. Show end date 482 str += " <i>" + TimeString::longDateString( ev.endDate() ) + "</i>";
484 str += TimeString::longDateString( ev.endDate() );
485 } else {
486 // Show end time.
487 str += TimeString::timeString( ev.end(), ampm, FALSE );
488 } 483 }